/* ==========================================================================
   Onix form layout — the surface of Components/Shared/FormSection.razor and
   FieldChooser.razor: the folds of a long form and the list of the fields it
   shows. Every colour is a token (css/onix-theme.css); both themes.

     .form-section          one fold: head (toggle · title · summary · tools) + body
     .form-pairs            label · field pairs in two aligned columns
     .field-chooser         the check-box list inside a RowMenu panel
   ========================================================================== */

/* ─── A fold of the form ────────────────────────────────────────────────── */

.form-section { margin: 0 0 2px; min-width: 0; }
.form-section__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    min-height: 26px;
    margin: 0 0 4px;
    border-bottom: 1px solid var(--hairline);
}
.form-section__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px 3px 0;
    border: 0;
    border-radius: var(--radius-xs);
    background: none;
    color: var(--ink);
    font: inherit;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
}
.form-section__toggle:hover { color: var(--brand-strong); }
.form-section__toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.form-section__chevron { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--muted); }
.form-section__chevron svg { width: 15px; height: 15px; transform: rotate(90deg); transition: transform var(--dur) var(--ease); }
.form-section.is-collapsed .form-section__chevron svg { transform: rotate(0deg); }
.form-section__summary {
    flex: 1 1 160px;
    min-width: 0;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.form-section__summary:hover { color: var(--ink); }
.form-section__summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: var(--radius-xs); }
.form-section__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.form-section__body { animation: pop-in 0.14s var(--ease); }
/* The fold's grid ends the fold: the next head brings its own room. */
.form-section__body > .form-grid:last-child,
.form-section__body > .form-lock > .form-grid:last-child,
.form-section__body > .form-lock > .form-pairs:last-child { margin-bottom: 4px; }

/* ─── Label · field pairs in two aligned columns ────────────────────────── */

/* The invoice editor's header and its Other information (Invoices.razor): every caption sits right-
   aligned beside its field on ONE grid — max-content · 1fr · max-content · 1fr — so the captions of a
   column line up whatever their length, and the fields with them. A pair is a <label> (or a
   .form-pair) whose first child is the caption and whose other children — the control, a note under
   it — stack in the field's column (subgrid). .span-all is a pair across the whole row (the caption
   still in the first column), .form-pairs__full a row without a caption (a panel); .is-left starts a
   new row, so a missing right-hand field leaves its cell empty instead of pulling the next pair up.
   The DOM order is the reading order — left, right, next row — and so the order Tab follows.
   The host (FormSection Class="form-pairs-host") is the container: a narrow form takes one pair a row.
   A run of pairs locked on its own (.form-lock--pairs, REV-015: a posted invoice keeps its texts editable and
   locks the rest) is a disabled fieldset that draws no box — display: contents — so its pairs are the grid's
   like the others; every rule below names them both ways. */
.form-pairs-host { container: form-pairs / inline-size; }
.form-pairs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    margin-bottom: 6px;
}
.form-pairs > .form-lock--pairs { display: contents; }
.form-pairs > :not(.form-pairs__full, .form-lock--pairs),
.form-pairs > .form-lock--pairs > :not(.form-pairs__full) {
    display: grid;
    grid-column: span 2;
    grid-template-columns: subgrid;
    align-items: center;
    row-gap: 1px;
    min-width: 0;
    margin: 0;
}
.form-pairs > :not(.form-pairs__full, .form-lock--pairs) > :first-child,
.form-pairs > .form-lock--pairs > :not(.form-pairs__full) > :first-child {
    grid-column: 1;
    max-width: 14em;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 550;
    line-height: 1.2;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-pairs > :not(.form-pairs__full, .form-lock--pairs) > :not(:first-child),
.form-pairs > .form-lock--pairs > :not(.form-pairs__full) > :not(:first-child) { grid-column: 2; min-width: 0; }
.form-pairs > :not(.form-pairs__full, .form-lock--pairs) > .button,
.form-pairs > .form-lock--pairs > :not(.form-pairs__full) > .button { justify-self: start; }
.form-pairs > :not(.form-pairs__full, .form-lock--pairs) > small,
.form-pairs > .form-lock--pairs > :not(.form-pairs__full) > small { line-height: 1.25; font-size: 0.72rem; }
.form-pairs > .is-left,
.form-pairs > .form-lock--pairs > .is-left { grid-column: 1 / span 2; }
.form-pairs > .span-all,
.form-pairs > .form-lock--pairs > .span-all { grid-column: 1 / -1; }
.form-pairs > .span-all > :not(:first-child),
.form-pairs > .form-lock--pairs > .span-all > :not(:first-child) { grid-column: 2 / -1; }
.form-pairs > .form-pairs__full,
.form-pairs > .form-lock--pairs > .form-pairs__full { grid-column: 1 / -1; min-width: 0; }

@container form-pairs (max-width: 560px) {
    .form-pairs { grid-template-columns: max-content minmax(0, 1fr); }
}
/* A phone: the caption over its field. */
@container form-pairs (max-width: 340px) {
    .form-pairs { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
    .form-pairs > :not(.form-pairs__full, .form-lock--pairs),
    .form-pairs > .form-lock--pairs > :not(.form-pairs__full),
    .form-pairs > .is-left,
    .form-pairs > .form-lock--pairs > .is-left,
    .form-pairs > .span-all,
    .form-pairs > .form-lock--pairs > .span-all { grid-column: 1 / -1; }
    .form-pairs > :not(.form-pairs__full, .form-lock--pairs) > :first-child,
    .form-pairs > .form-lock--pairs > :not(.form-pairs__full) > :first-child,
    .form-pairs > :not(.form-pairs__full, .form-lock--pairs) > :not(:first-child),
    .form-pairs > .form-lock--pairs > :not(.form-pairs__full) > :not(:first-child),
    .form-pairs > .span-all > :not(:first-child),
    .form-pairs > .form-lock--pairs > .span-all > :not(:first-child) { grid-column: 1; }
    .form-pairs > :not(.form-pairs__full, .form-lock--pairs) > :first-child,
    .form-pairs > .form-lock--pairs > :not(.form-pairs__full) > :first-child { max-width: none; text-align: left; white-space: normal; }
}

/* ─── One column of label-left rows (IDE-001, the accountant's Variant C) ─ */

/* The invoice editor's header (Invoices.razor): ONE column of rows, the caption at the left in a column
   of fixed width, the field filling the rest and, on some rows, a companion control in a third cell at
   the right (the VAT number beside the ЕИК, the numerator beside the number, the period beside the
   date, the currency beside the amount). The grid is
   caption · field · side; a row is a <label> (or a .form-pair) whose first child is the caption and
   whose other children stack in the field cell (subgrid) — it spans the whole width unless it carries
   .has-side, which leaves the third cell to the .form-column__side element that follows it in the DOM
   (auto-placed into that cell). .form-column__side--contents is a side cell whose content is a
   component's own <label> (its caption is read by screen readers, not drawn); .span-all and
   .form-pairs__full keep their meaning from .form-pairs. The DOM order is the reading order — down
   the column — and so the Tab order. A run locked on its own (.form-lock--pairs) draws no box, as in
   .form-pairs. The host (FormSection Class="form-pairs-host") is the container: a narrow form puts the
   side under its field. */
.form-column {
    display: grid;
    grid-template-columns: 11em minmax(0, 1fr) minmax(0, 12em);
    gap: 3px 10px;
    align-items: center;
    margin-bottom: 6px;
}
.form-column > .form-lock--pairs { display: contents; }
.form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side),
.form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    row-gap: 1px;
    min-width: 0;
    margin: 0;
}
.form-column > .has-side,
.form-column > .form-lock--pairs > .has-side { grid-column: 1 / span 2; }
.form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :first-child,
.form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > :first-child {
    grid-column: 1;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 550;
    line-height: 1.2;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :not(:first-child),
.form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > :not(:first-child) { grid-column: 2 / -1; min-width: 0; }
.form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > .button,
.form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > .button { justify-self: start; }
.form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > small,
.form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > small { line-height: 1.25; font-size: 0.72rem; }
.form-column > .form-pairs__full,
.form-column > .form-lock--pairs > .form-pairs__full { grid-column: 1 / -1; min-width: 0; }
/* The companion cell: a control that fills it, or a read-only text. */
.form-column > .form-column__side,
.form-column > .form-lock--pairs > .form-column__side {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    font-size: inherit;
}
.form-column .form-column__side > input,
.form-column .form-column__side > select,
.form-column .form-column__side > .lookup { flex: 1 1 auto; width: 100%; min-width: 0; }
.form-column .form-column__text {
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
/* A side cell made of a component's own label (the accounting period): the label fills the cell, its
   caption and its note are for screen readers, its confirmation takes a row of its own. */
.form-column > .form-column__side--contents,
.form-column > .form-lock--pairs > .form-column__side--contents { display: contents; }
.form-column .form-column__side--contents > label { grid-column: 3; display: flex; flex-direction: column; min-width: 0; margin: 0; }
.form-column .form-column__side--contents > label > span:first-child,
.form-column .form-column__side--contents > label > small {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.form-column .form-column__side--contents > label > span:not(:first-child) { min-width: 0; }
.form-column .form-column__side--contents > label select { flex: 1 1 auto; min-width: 0; }
.form-column .form-column__side--contents > .span-all { grid-column: 1 / -1; }

/* A narrow form: the companion under its field, in the field's column. */
@container form-pairs (max-width: 560px) {
    .form-column { grid-template-columns: 9em minmax(0, 1fr); }
    .form-column > .has-side,
    .form-column > .form-lock--pairs > .has-side { grid-column: 1 / -1; }
    .form-column > .form-column__side,
    .form-column > .form-lock--pairs > .form-column__side,
    .form-column .form-column__side--contents > label { grid-column: 2; }
}
/* A phone: the caption over its field. */
@container form-pairs (max-width: 340px) {
    .form-column { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
    .form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side),
    .form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side),
    .form-column > .form-column__side,
    .form-column > .form-lock--pairs > .form-column__side,
    .form-column .form-column__side--contents > label { grid-column: 1 / -1; }
    .form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :first-child,
    .form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > :first-child,
    .form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :not(:first-child),
    .form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > :not(:first-child) { grid-column: 1; }
    .form-column > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :first-child,
    .form-column > .form-lock--pairs > :not(.form-pairs__full, .form-column__side) > :first-child { white-space: normal; }
}

/* ─── The field chooser ─────────────────────────────────────────────────── */

.field-chooser { display: flex; flex-direction: column; min-width: 240px; padding: 2px 0; white-space: normal; }
.field-chooser__group {
    padding: 8px 10px 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
/* Inside a form card its labels are block captions (app.css .form-card label): these are rows. */
.row-menu-panel .field-chooser__item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 9px;
    cursor: pointer;
}
.row-menu-panel .field-chooser__item:hover { background: var(--panel-hover); }
.row-menu-panel .field-chooser__item input { margin: 0; flex: none; }
.row-menu-panel .field-chooser__item > span {
    display: inline;
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
}
.row-menu-panel .field-chooser__item.is-hidden > span { color: var(--muted); }
/* "In the header": a second column of boxes, under its heading (the form's OnPin). */
.field-chooser__legend {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 10px 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.field-chooser__row { display: flex; align-items: center; gap: 6px; }
.row-menu-panel .field-chooser__row > .field-chooser__item { flex: 1 1 auto; min-width: 0; }
.row-menu-panel .field-chooser__pin {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    margin: 0;
    padding: 6px 0;
    border-radius: 9px;
    cursor: pointer;
}
.row-menu-panel .field-chooser__pin:hover { background: var(--panel-hover); }
.row-menu-panel .field-chooser__pin input { margin: 0; }
.field-chooser__note { margin: 6px 10px 2px; color: var(--muted); font-size: 0.78rem; }
.field-chooser__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding: 8px 10px 4px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
}
/* The foot's link, not a menu item. */
.row-menu-panel .field-chooser__foot button {
    display: inline;
    width: auto;
    padding: 0;
    border-radius: 0;
    color: var(--brand);
    font-weight: 550;
}
.row-menu-panel .field-chooser__foot button:hover:not(:disabled) { background: none; color: var(--brand-strong); text-decoration: underline; }
.row-menu-panel .field-chooser__foot button:disabled { color: var(--muted-2); }

@media print {
    .form-section__chevron, .form-section__tools, .field-chooser__button { display: none; }
}

/* ─── Colour: the fold's chevron and hover in the app's colour ──────────── */
.form-section__chevron { color: var(--app-ink, var(--brand)); }
.form-section__toggle:hover { color: var(--app-ink, var(--brand-strong)); }
.form-section__head { border-bottom-color: color-mix(in srgb, var(--app-color, var(--brand)) 18%, var(--hairline)); }

/* A record's history (Odoo's chatter): the notes, the e-mails received, what other apps logged — CRM's lead form. */
.record-history__compose { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.record-history__compose textarea { flex: 1; }
.crm-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crm-history__item { border-left: 3px solid var(--line); padding: 6px 10px; background: var(--panel); border-radius: var(--radius-xs, 4px); }
.crm-history__item--emailin { border-left-color: var(--brand); }
.crm-history__item--system { border-left-color: var(--muted); }
/* OP-012 / OP-058: Mayla's draft reply on a lead (unsent) and a reply sent from the lead. */
.crm-history__item--draft { border-left-color: var(--brand); border-left-style: dashed; background: var(--panel-2, var(--panel)); }
.crm-history__item--emailout { border-left-color: var(--ok, #16a34a); }
.crm-history__draft { width: 100%; margin: 6px 0; }
.crm-history__hint { margin: 4px 0 0; font-size: 12px; }
.crm-history__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.crm-history__text { white-space: pre-line; }
.crm-history__file { display: inline-block; margin-right: 10px; font-size: 13px; }
/* OP-064: a helpdesk ticket's thread (TicketMessages.razor) — the same look; the question Mayla handed over and the notes. */
.crm-history__item--handoff { border-left-color: var(--warn); }
.crm-history__item--note { border-left-style: dotted; }
.ticket-tabs { margin: 12px 0 8px; }

/* OP-059: the activities of a lead / partner (the strip) and My activities (day, week, list). */
.crm-activities { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.crm-activity { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-left: 3px solid var(--brand); padding: 6px 10px; background: var(--panel); border-radius: var(--radius-xs, 4px); font-size: 13px; }
.crm-activity.is-overdue { border-left-color: var(--danger); }
.crm-activity.is-done { border-left-color: var(--muted); opacity: .75; }
.crm-activity.is-done .crm-activity__subject { text-decoration: line-through; }
.crm-activity__when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.crm-activity__subject { font-weight: 600; }
.crm-activities__history { margin-top: 8px; }
.crm-activities__history > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.crm-next { font-size: 12px; color: var(--brand-strong); }
.crm-next.is-overdue { color: var(--danger); font-weight: 600; }
.crm-cal__title { margin: 0 6px; }
.crm-cal__overdue h3, .crm-cal__day h3 { font-size: 14px; margin: 12px 0 6px; display: flex; gap: 8px; align-items: center; }
.crm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.crm-week__day { border: 1px solid var(--line); border-radius: var(--radius-xs, 4px); padding: 6px; min-height: 140px; background: var(--panel); display: grid; align-content: start; gap: 4px; }
.crm-week__day.is-today { border-color: var(--brand); box-shadow: inset 0 2px 0 var(--brand); }
.crm-week__head { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.crm-week__item { display: grid; gap: 2px; text-align: left; font: inherit; font-size: 12px; padding: 4px 6px; border: 0; border-left: 3px solid var(--brand); border-radius: var(--radius-xs, 4px); background: var(--brand-soft); color: inherit; cursor: pointer; }
.crm-week__item.is-overdue { border-left-color: var(--danger); }
.crm-week__item.is-done { border-left-color: var(--muted); opacity: .7; text-decoration: line-through; }
.crm-week__subject { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-week__empty { text-align: center; }
@media (max-width: 900px) { .crm-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ─── IDE-004: the document condition (състояние) ────────────────────────
   The chip the invoice editor shows right after the state steps — "Condition: Duplicated — the same number as … / …", its
   click opens the notices — and the list's Document condition cell: pink for a duplicate, red for a wrong document, amber
   for an unusual amount or date (Check), the review tone for a later period. The fields a reason names are red
   (.is-condition-error on the input, or on the side cell that holds the period's select), their caption too. */
.invoice-condition-chip { white-space: nowrap; max-width: 52ch; overflow: hidden; text-overflow: ellipsis; }
button.invoice-condition-chip { cursor: pointer; border: 0; font: inherit; }
.invoice-condition--duplicate { background: var(--hue-rose-soft); color: var(--hue-rose); }
.invoice-condition--wrong { background: var(--danger-soft); color: var(--danger-strong); }
.invoice-condition--check { background: var(--state-overdue-soft); color: var(--state-overdue); }
.invoice-condition--later { background: var(--state-warn-soft); color: var(--state-warn); }
input.is-condition-error,
select.is-condition-error,
.is-condition-error select { color: var(--danger-strong); border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
label:has(> input.is-condition-error) > span:first-child { color: var(--danger-strong); }

/* IDE-013 — CountryMultiSelect (Components/Shared): the chosen countries as chips with a remove button, then the
   select that adds one more. Theme tokens only (light and dark). */
.country-multi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.country-multi__chip { font-size: 0.8rem; padding: 3px 4px 3px 10px; }
.country-multi__remove {
    display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: inherit; line-height: 1; cursor: pointer;
}
.country-multi__remove:hover, .country-multi__remove:focus-visible { background: var(--danger-soft); color: var(--danger-strong); }
.country-multi__none { font-size: 0.85rem; }
.country-multi .country-multi__add { flex: 1 1 12rem; min-width: 10rem; max-width: 22rem; }

/* ─── ATP-020: a panel's label-left rows (.form-column.form-rows) ───────── */

/* The invoice header's rows (.form-column above) in a panel — the bank matching panels (Set account, Set partner,
   Internal transfer, the Match pane's tabs), the Reconcile page's dialogs: TWO columns, the caption at the left in a
   column of fixed width (--form-label-width, set per panel by its own sheet), the field beside it filling the rest.
   A row is still a <label> whose first child is the caption; a long caption wraps inside its column instead of being
   cut. The fields are framed — the theme's standard input border, as the toolbar's — not the underlined field of
   .form / .form-card: the accountant's "the field beside the text, not one under the other, no lines". Tokens only. */
.form-column.form-rows {
    grid-template-columns: var(--form-label-width, 9em) minmax(0, 1fr);
    gap: 6px 12px;
    margin-bottom: 10px;
}
.form-column.form-rows > :not(.form-pairs__full, .form-lock--pairs, .form-column__side) > :first-child {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}
.form-column.form-rows input:not([type=checkbox]):not([type=radio]),
.form-column.form-rows select,
.form-column.form-rows textarea {
    width: 100%;
    min-height: 30px;
    padding-top: 3px;
    padding-bottom: 3px;
    padding-left: 9px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.3;
    background: var(--panel);
    color: var(--ink);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-column.form-rows input:not([type=checkbox]):not([type=radio]):not(.lookup-input) { padding-right: 9px; }
.form-column.form-rows input:not([type=checkbox]):not([type=radio]):hover,
.form-column.form-rows select:hover,
.form-column.form-rows textarea:hover { border-color: var(--muted-2); background: var(--panel); }
.form-column.form-rows input:not([type=checkbox]):not([type=radio]):focus,
.form-column.form-rows select:focus,
.form-column.form-rows textarea:focus { outline: none; border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--ring); }
.form-column.form-rows input:not([type=checkbox]):not([type=radio]):disabled,
.form-column.form-rows select:disabled { opacity: 0.6; cursor: not-allowed; border-color: var(--line); }

/* ─── ATP-012: the invoice editor, the clean Odoo pass ───────────────────── */

/* The lines fit the pane (InvoiceLinesGrid's width budget): the grid does not scroll sideways — no scrollbar for a
   pixel of rounding — until the chosen columns are wider than the pane; js/onix-editgrid.js then marks it
   data-edg-wide, the box scrolls and the column chooser says why (.field-chooser__wide, any line grid). */
.edg.invoice-lines:not([data-edg-wide]) .edg-scroll { overflow-x: clip; }
.field-chooser__wide {
    display: none; margin: 6px 10px 2px; color: var(--warn); font-size: 0.78rem;
    text-transform: none; letter-spacing: normal; font-weight: 500; white-space: normal;   /* not the grid head's caps */
}
.edg[data-edg-wide] .field-chooser__wide { display: block; }
/* The keys of the lines grid: a glyph whose tooltip says them, at the end of the add links. */
.edg-bar .edg-bar-keys { margin-left: auto; color: var(--muted); cursor: help; font-size: 0.95rem; line-height: 1; }

/* The decision row of a draft: Cancel (outline, red) at the left of Validate; armed, it asks once more. */
.editor-decision__cancel { color: var(--danger-strong); }
.editor-decision__cancel:disabled { color: var(--muted-2); }
.editor-decision__keep svg { width: 14px; height: 14px; }

/* The Accounting entries tab: its two views (Дт / Кт · Journal items), a small segmented switch over the grid. */
.onix-segmented.invoice-entries-views { margin: 0 0 6px; padding: 2px; }
.onix-segmented.invoice-entries-views button { padding: 4px 12px; font-size: 12px; }
.invoice-journal-items .ji-partner, .invoice-journal-items .ji-taxes { color: var(--ink-soft); }
.invoice-journal-items tfoot tr.ji-balance td { color: var(--muted); font-weight: 500; }
.invoice-journal-items tfoot tr.ji-balance.is-off td { color: var(--danger-strong); }
