﻿/* ============================================================
   Customer orders list (/order), abena-v3 redesign.

   Lives in its own file rather than in Abena-commande.css because that sheet is
   linked BEFORE Abena-v3.css in _Host.cshtml and therefore cannot override the v3
   rules; it also still owns the admin grid and the order edit/view screens
   (.tag.*-commande-tag, .default-badge, .cde-top-bar .left/.right), which this
   redesign deliberately leaves alone.

   Geometry follows the Resident / Room / ProgressionPlan design system; the values
   that are specific to the orders prototype are called out inline.
   ============================================================ */

/* ---------- Page shell ----------
   .abs-page ships 1.25rem/2rem padding, a 1.25rem side margin, a white ground and a
   0.625rem radius (Abena-main.css). The Resident and Room pages strip all of that so their
   v3 header can sit flush against the page edges; without the same reset this header was
   inset by 2rem and pushed down by 1.25rem, and the block read as taller than theirs.
   Mirrors `.abs-page:has(.resident-main-page)` and `.abs-page:has(.room-main-page)`. */
/* The drawer hands `flex: 1 1 auto` to the page region through
   `.k-drawer-content > :nth-child(2)` (Abena-main-layout.css) — but /order suppresses the global
   yellow row, so the page is :nth-child(1) and that rule never matches. Nothing below is then a
   flex item, the grid stops at its content height, and the drawer's white ground shows under the
   pager.

   The admin page had the same two selectors without the grow, and the same white band under its
   pager; both pages now carry the full chain and neither grid needs an inline Height. */
.abs-left-bar > .k-drawer-container > .k-drawer-content > div:has(.order-main-page) {
    display: flex;
    flex-direction: column;
    /* The grow the `:nth-child(2)` rule would have granted. Without it this div is content-sized,
       every percentage below resolves against an indefinite height, and `flex-basis: 0` on the
       grid collapses it to nothing — which is what the first attempt at this fix produced. */
    flex: 1 1 auto;
    min-height: 0;
}

.abs-page:has(> .order-main-page) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    margin: 0;
    background-color: var(--sn-surface-subtle);
}

/* The page fills its parent, which is now definite all the way up — see the two rules above.

   A flex chain alone is not enough here: `.abs-page` (AbsPageLayout) is display:block /
   height:auto, and the drawer rule that hands out `flex: 1 1 auto`
   (`.k-drawer-content > :nth-child(2)`, Abena-main-layout.css) only matches when the global
   top row renders first — which this no-topbar route removes. `height: calc(100vh -
   var(--top-bar-height))` guesses the viewport instead of filling the parent and leaves a
   white strip of the drawer's ground below the page. The fix is to make the ancestors
   definite rather than to guess: the two rules above do exactly that, and they are what the
   admin page carries too. */
.order-main-page {
    display: flex;
    flex-direction: column;
    /* Grows into the parent rather than guessing the viewport, and rather than a percentage of
       it: `flex` needs no definite parent height to resolve, a percentage does. */
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* ---------- Typography ----------
   The live prototype measures: header cell and Type cell are Gilroy 14px, and the grid
   rendered Roboto. Both lists stay listed in the shared Roboto scope (Abena-v3.css) and
   simply re-point its token here — every rule there reads `var(--abena-v3-font)` and
   resolves it at the element, so this one declaration covers the page AND every Kendo widget
   inside it, the grid included. No second `:is(...)` list to keep in step.

   Gilroy-Regular, not Gilroy-Medium, and the reason is not obvious: the prototype self-hosts
   Gilroy at 400/600/700 ONLY. Its declared `font-weight: 500` finds no Medium face and matches
   DOWN to 400 — so what DevTools reports as 500 actually RENDERS REGULAR. This app does ship a
   real Gilroy-Medium, so copying the 500 literally would render heavier than the design. Same
   conclusion, and the same named single-weight family, as `.order-edit-page` further down.
   Only the prototype's genuine 600 runs (N° commande, Montant TTC) take a heavier face. */
.order-main-page,
.admin-order-main-page {
    --abena-v3-font: 'Gilroy-Regular', 'Gilroy', sans-serif;
    font-weight: 400;
}

/* Fixed-height header above the scrolling list — never squeezed by the flex algorithm. */
.order-main-page > .abena-v3-top-bar-header--page {
    flex: 0 0 auto;
}

/* The page header is flush to the page edges; the list below keeps the standard
   content gutter. */
.order-main-page__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* Now that the chain above is definite, the grid fills the content region instead of
   under-shooting it by its own calc(). This rule is deliberately NOT cloned from
   Abena-commande.css because it would fight the TelerikGrid's own Height=calc(...) — true
   while the page had no definite height, since a percentage height would have resolved
   against an auto-height ancestor. It no longer does.

   NOTE the difference from /room and /resident, which solve the same problem with
   `height: 100% !important` (Abena-room.css, Abena-resident.css): their `.abs-grid` wrapper
   contains ONLY the TelerikGrid (RoomMainGrid.razor:11, ResidentMainGrid.razor:11), so 100%
   of it is correct. `.order-list-grid` also contains the toolbar (count + status filter +
   search + Réinit.), so 100% overshoots by the toolbar's height and pushes the pager below
   the fold — precisely what the Abena-room.css comment warns about. The grid therefore takes
   the REMAINING space via flex rather than the full height; `flex-basis: 0` is what defeats
   the inline `Height="calc(100vh - 16rem)"`, since the flex algorithm ignores the height
   property on the main axis. */
.order-main-page__content > .order-list-grid {
    flex: 1;
    min-height: 0;
}

.order-main-page__content > .order-list-grid > .abena-v3-top-bar {
    flex: 0 0 auto;
}

.order-main-page__content > .order-list-grid > .k-grid {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
}

/* ---------- "Nouvelle commande" CTA ----------
   This is a real AbenaV3Button: the type is chosen in the panel, so the TelerikMenu — and the
   `.abs-add-button.k-menu.k-menu-horizontal` background and fixed height that had to be
   overridden to make it look like a button — are gone. The prototype's plain `uil-plus` is
   passed as UniconsIcon; only the icon size needs pinning. */
.order-main-page .order-new-order-button i {
    font-size: var(--kendo-font-size-md);
    line-height: 1;
}

/* ---------- Toolbar ----------
   Structure and the count/search come from the Resident top bar
   (.abena-v3-top-bar-row / .abena-v3-list-count / .abena-v3-grid-search). The filter
   controls come from the shared `.abena-v3-toolbar-filters` (Abena-v3.css).
   Only the width below is specific to this screen. */
.order-list-filters .k-dropdownlist {
    width: 11.25rem !important;
}

/* Value padding is per-consumer, not shared: this list uses the prototype's 11px where both
   ProgressionPlan toolbars use 8px. */
.order-list-filters .k-dropdownlist .k-input-inner {
    padding-left: 0.6875rem;
    padding-right: 0;
}

/* Two controls the page token cannot reach on its own, both because something else already
   claimed them with a higher-specificity rule:
     - the search field — Abena-v3.css pins every `.search-with-icon` input to Roboto with
       !important, app-wide;
     - the status filter — the shared `.abena-v3-toolbar-filters` names Gilroy-Medium, which is
       what its other two consumers (ProgressionPlan) render and must keep.
   A search box in a different face from the filter beside it is exactly the mismatch the review
   reported, so both are pulled back onto the page token. */
:is(.order-main-page, .admin-order-main-page) .abena-v3-grid-search .search-with-icon :is(.k-input, .k-input-inner, input),
:is(.order-main-page, .admin-order-main-page) .abena-v3-grid-search .search-with-icon :is(.k-input-inner, input)::placeholder,
:is(.order-main-page, .admin-order-main-page) .abena-v3-toolbar-filters :is(.k-picker, .k-input, .k-input-inner, .k-input-value-text) {
    font-family: var(--abena-v3-font) !important;
}

/* White ground, border and radius now come from the shared `.abena-v3-form .k-input/.k-picker`
   (Abena-v3.css), which this block used to restate — with the wrong border colour at that
   (#c9d2dc against the design's #DFE3E8). Only the height is left: the shared kit sizes pickers
   (38px) but not plain inputs, and this panel is the one place that pairs a numeric input and a
   picker on the same row, where a height difference would show. */
.new-order-panel .k-input {
    height: 2.375rem;
}

/* Reset link — .abena-v3-link-button supplies colour, size and the hover underline;
   this only adds the leading icon. The typeface now comes from the page (Gilroy), so the
   font rule this block used to carry is gone. */
.order-list-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.order-list-reset i {
    font-size: 0.9375rem;
    line-height: 1;
}

/* ---------- Grid cells ---------- */
.order-list-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Column floor. The columns are sized in % (OrderListGrid.razor), so on their own they keep
   shrinking with the window until the labels are cut. A min-width on the two grid tables makes
   those percentages resolve against 990px as soon as the grid is narrower than that, and
   `.k-grid-content` — already `overflow-x: auto` — starts scrolling horizontally instead;
   Telerik keeps `.k-grid-header-wrap` scrolled in sync with it, so the header follows the body.

   990px is the smallest table width at which every column still holds its content. Measured on
   the live grid (Gilroy 14px header / 12px status pill, 0.75rem cell padding each side):

     column         % of table   at 990px   needs
     N° commande       14.0%       131px     116px — the "N° commande" header (92px) + padding
     Type              18.5%       173px    ~170px — free text (dotation label), ellipsised by design
     Date              14.8%       138px     125px — calendar icon + gap + "20/08/2025"
     Passée par        18.5%       173px     165px — 32px avatar + gap + a full name
     Statut            19.3%       180px     174px — the longest pill, "En attente de validation"
                                                     (132px + the pill's 2 × 9px padding)
     Montant TTC       14.8%       138px     107px — the "Montant TTC" header + padding
     Actions           56px         56px      56px — fixed

   "Statut" is the binding column: 174 / 0.193 + 56 ≈ 990. Keep this number in step with the
   column percentages above it — widening a column lowers the floor its neighbours resolve to. */
.order-list-grid .k-grid-header-table,
.order-list-grid .k-grid-table {
    min-width: 990px;
}

/* Cell styling shared by BOTH order lists — the customer one and the admin one. Each rule
   names the two page scopes so a cell cannot drift between the screens: the admin "Reçue le"
   column and the customer "Date" column are the same cell.

   N° commande and Montant TTC — the prototype's `.td-strong` (14px / 600 / #0D1740).
   Montant TTC is bold by explicit request.

   The face is named: Gilroy ships one family per weight, so `font-weight: 600` alone on the
   page's Gilroy-Regular would only synthesise a fake bold. `--primary-bold` is Gilroy-SemiBold,
   the real 600 the prototype uses here. */
.order-main-page .ord-cell-strong,
.admin-order-main-page .ord-cell-strong {
    font-family: var(--primary-bold);
    font-weight: var(--kendo-font-weight-semibold, 600);
    color: var(--abena-color-page-title);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Date cell — blue calendar glyph + navy text. */
.order-main-page .ord-date,
.admin-order-main-page .ord-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    color: var(--abena-color-text-navy);
    white-space: nowrap;
}

.order-main-page .ord-date i,
.admin-order-main-page .ord-date i {
    font-size: 1rem;
    line-height: 1;
    color: var(--abena-color-action-blue);
}

/* "Passée par" — round initials avatar + name. */
.order-main-page .ord-user,
.admin-order-main-page .ord-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5625rem;
    min-width: 0;
}

.order-main-page .ord-avatar,
.admin-order-main-page .ord-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--abena-color-action-blue);
    color: var(--color-ink-inverse);
    font-size: 0.75rem;
    font-weight: var(--kendo-font-weight-bold);
    line-height: 1;
}

.order-main-page .ord-user__name,
.admin-order-main-page .ord-user__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--abena-color-page-title);
}

/* The status pill carries no rule here any more. The prototype's smaller, dot-less variant
   is asked for on the component itself — `<AbenaV3StatusBadge Compact="true" ShowDot="false"/>`
   — instead of being imposed on `.res-badge` from this page's scope. */

/* No grid-header rule here any more. The shared `.abena-v3-grid .k-grid-header .k-table-th`
   (Abena-v3.css) already renders 14px / 500 / #4F4F4F — the prototype's `.th` exactly — so
   restating the weight and colour here was redundant. The height it also forced (2.125rem)
   was measured while the page was still being shrunk by the width breakpoints; with /order out
   of that scaling the shared height is the right one.

   The header's horizontal padding is the reason "Actions" rendered as "Act…": the shared cell
   pads 0.75rem each side, which leaves 32px of a 56px column for a ~50px label. The prototype's
   own action column is 56px with no padding, so match it — on the LAST column only, and only on
   the customer list; the admin grid's last column has no title to truncate. */
.order-main-page .k-grid-header .k-table-th:last-child {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* "Type" cell — the prototype's `.td-muted` (--fg-secondary = --color-gray-500). */
.order-main-page .ord-cell-muted,
.admin-order-main-page .ord-cell-muted {
    color: var(--color-gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Amount hidden for establishments with ShowPrices == false. */
.order-main-page .ord-cell-na,
.admin-order-main-page .ord-cell-na {
    color: var(--abena-color-text-muted);
}

/* ============================================================
   Admin orders list (/admin/order).

   The page carries the same v3 shell as the customer list — its own page header, the
   `.abs-page` reset so that header sits flush, and a real TelerikGrid with a pager instead of
   the hand-written table. `.cde-main-page` is kept alongside so the toolbar and multi-select
   plumbing in Abena-commande.css still applies. Columns, export, sold-to filter and summary
   modal unchanged.

   The customer-number / establishment column work is deliberately NOT done here: the exact
   columns still need client validation.
   ============================================================ */

/* Same reset as the customer list: .abs-page ships padding, a side margin, a white ground and
   a radius, all of which would inset the v3 header. See the `.order-main-page` rule above. */
.abs-page:has(> .admin-order-main-page) {
    padding: 0 !important;
    margin: 0;
    background-color: var(--sn-surface-subtle);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.abs-left-bar > .k-drawer-container > .k-drawer-content > div:has(.admin-order-main-page) {
    display: flex;
    flex-direction: column;
    /* Same missing grow as the customer page had: `.k-drawer-content > :nth-child(2)` never
       matches on a no-topbar route, so nothing below was a flex item and the grid stopped at the
       height its own inline calc() guessed — leaving the drawer's ground showing under the pager. */
    flex: 1 1 auto;
    min-height: 0;
}

.admin-order-main-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The header is flush to the page edges; the toolbar and grid keep the content gutter. */
.admin-order-main-page__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

/* Toolbar sits on the page background, above the grid card. */
.admin-order-main-page .cde-top-bar {
    padding-bottom: 0.75rem;
}

/* Search, sold-to picker and status picker — 37px / 8px radius, as on the customer list. */
.admin-order-main-page .cde-top-bar .k-picker,
.admin-order-main-page .cde-top-bar .k-input,
.admin-order-main-page .cde-top-bar .search-with-icon {
    background: #fff;
    border: 0.0625rem solid #c9d2dc;
    border-radius: 0.5rem;
    height: 2.3125rem;
}

.admin-order-main-page .cde-top-bar .search-with-icon .k-input,
.admin-order-main-page .cde-top-bar .search-with-icon .k-textbox {
    border: none !important;
    height: 100%;
    background: transparent !important;
}

.admin-order-main-page .cde-top-bar .k-input-value-text,
.admin-order-main-page .cde-top-bar .k-input-inner {
    color: var(--abena-color-page-title);
    font-size: 0.875rem;
}

/* Export / info buttons — the v3 solid primary look, 37px to line up with the pickers.
   Moved from the filters bar to the page header, so the selector names both containers rather
   than `.cde-top-bar` alone. */
.admin-order-main-page .cde-top-bar .add-button.k-button,
.admin-order-main-page .admin-order-list-actions .add-button.k-button {
    height: 2.3125rem;
    min-height: 2.3125rem;
    padding: 0 1rem;
    border-radius: 0.5rem;
    border-color: var(--abena-color-action-blue);
    background: var(--abena-color-action-blue);
    color: var(--color-ink-inverse);
    font-size: var(--kendo-font-size-md);
    font-weight: var(--kendo-font-weight-medium);
}

.admin-order-main-page .cde-top-bar .add-button.k-button:hover,
.admin-order-main-page .admin-order-list-actions .add-button.k-button:hover {
    border-color: var(--kendo-color-info-active);
    background: var(--kendo-color-info-active);
}

.admin-order-main-page .admin-order-list-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sold To carries the same v3 dressing as the status picker, but not its width: the shared
   `.order-list-filters .k-dropdownlist` rule pins 11.25rem, which truncates an account name. */
.order-list-filters--wide .k-dropdownlist {
    width: 22rem !important;
}

/* The title moved to the page header, so `.cde-top-bar` lost its `.left` block and
   `justify-content: space-between` (Abena-commande.css) had nothing left to push against.
   Keep the filters right-aligned. */
.admin-order-main-page .cde-top-bar .right {
    margin-left: auto;
}

/* ============================================================
   "Nouvelle commande" panel (NewOrderPanel, SlidePanel).

   Almost nothing is left here: the drawer chrome comes from `.abena-v3-slide-panel` (+ the
   `--medium` variant, the design's 560px), the form from the shared `.abena-v3-form*` kit, the
   footer recap from `.abena-v3-info-box` — all in Abena-v3.css.

   Only three things are genuinely this panel's own: the two-column card grid, its typeface, and
   a footer without a divider.
   ============================================================ */

/* TYPOGRAPHY — the prototype's font is Gilroy; `.abena-v3-slide-panel` is in the shared Roboto
   scope, so the drawer rendered in the wrong typeface. Re-point the token rather than leave the
   scope: every rule there reads `var(--abena-v3-font)` and resolves it at the element, so this
   one declaration covers the panel and every Kendo widget in it. Same move as the order list.

   Gilroy-Regular, not Gilroy-Medium: the prototype self-hosts Gilroy at 400/600/700 only, so its
   declared `font-weight: 500` matches DOWN to 400 and RENDERS REGULAR. Copying the 500 literally
   would render heavier than the design. Same conclusion as `.order-edit-page`. */
.abena-v3-slide-panel.new-order-panel {
    --abena-v3-font: 'Gilroy-Regular', 'Gilroy', sans-serif;
}

/* The design's `.drawer-footer` carries no divider — and one would sit directly above the blue
   recap, which reads as a stray line. The shared footer draws it for the panels that have no
   recap to introduce. */
.abena-v3-slide-panel.new-order-panel .abena-v3-slide-panel__footer {
    border-top: none;
}

/* Two columns, as a GRID. The shared group is a non-wrapping flex row; switching it to
   wrap + a percentage basis is not enough here — the cards carry their own padding and
   nothing guarantees border-box on them, so the basis overflows and each card takes a row.
   A grid sizes the tracks itself and cannot drift. */
.new-order-panel .abena-v3-radio-card-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem; /* 10px — design .type-grid */
}

/* The prototype's card is left-aligned and stacked: icon square on its own line, then the
   label, then the description — and a check badge in the top-right corner instead of the
   shared radio. Shaped here rather than in AbenaV3RadioCardOption so the component keeps
   rendering the way the DE resident sheet expects. */
.new-order-panel .abena-v3-radio-card {
    box-sizing: border-box;
    position: relative;
    flex: none;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.375rem; /* 6px — design .type-option */
    padding: 0.875rem 0.75rem; /* 14px 12px */
    border-color: rgba(0, 61, 125, 0.173); /* design --border-default */
    /* The shared card floors itself at 90px for the single-row layouts it was built for. Here
       the 2x2 grid already equalises each row, and the design sets no floor — leaving it in
       padded the cards out. */
    min-height: 0;
}

/* Design `.type-option:hover` — the shared card has no hover state at all, so an unselected
   card gave no feedback before the click. Scoped here rather than added to the component: the
   resident screens use the same card with a GREY checked ground, so a blue hover is this
   design's, not everyone's. */
.new-order-panel .abena-v3-radio-card:hover {
    border-color: var(--abena-color-action-blue);
    background: var(--abena-color-action-blue-soft);
}

/* Design `.type-option.selected`. The shared component already paints the border blue — the
   inset shadow is what doubles it, and it is drawn INSIDE the box so selecting a card cannot
   shift the grid by a pixel the way a 2px border would. */
.new-order-panel .abena-v3-radio-card--checked {
    background: var(--abena-color-action-blue-soft);
    box-shadow: inset 0 0 0 0.0625rem var(--abena-color-action-blue);
}

.new-order-panel .abena-v3-radio-card__header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.375rem; /* 6px, as between every other child of the card */
    width: 100%;
}

/* Design `.type-ico`: 32px square, 16px glyph. The shared card draws a 28/14 one. */
.new-order-panel .abena-v3-radio-card__icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
}

/* Design `.type-name`: 14px / 600 / #0D1740. The 600 needs the named SemiBold face — Gilroy
   ships one family per weight, so a weight alone would synthesise a fake bold. */
.new-order-panel .abena-v3-radio-card__label {
    align-items: flex-start;
    text-align: left;
    font-family: var(--primary-bold);
    font-weight: 600;
    color: var(--abena-color-page-title);
    line-height: 1.3;
}

/* Design `.type-dur`: 12px, muted — the shared card matches the label's 14px. */
.new-order-panel .abena-v3-radio-card__description {
    text-align: left;
    font-size: 0.75rem;
    color: var(--abena-color-text-muted, var(--color-gray-500));
}

/* The radio becomes the corner badge: a filled disc holding a white tick, drawn with
   borders so it needs no icon font. */
.new-order-panel .abena-v3-radio-card__radio {
    position: absolute;
    top: 0.5rem; /* 8px — design .type-check */
    right: 0.5rem;
    width: 1.125rem;
    height: 1.125rem;
    border: 0.0625rem solid transparent;
    background: transparent;
}

.new-order-panel .abena-v3-radio-card--checked .abena-v3-radio-card__radio {
    border: none;
    background: var(--abena-color-action-blue);
}

.new-order-panel .abena-v3-radio-card--checked .abena-v3-radio-card__radio::after {
    content: "";
    position: absolute;
    top: 0.1875rem;
    left: 0.375rem;
    width: 0.25rem;
    height: 0.5rem;
    border: solid var(--color-ink-inverse);
    border-width: 0 0.125rem 0.125rem 0;
    transform: rotate(45deg);
}

/* The recommendations hint is the only one that carries a glyph (design `.f-hint > i`). The
   app's global `i { line-height: 1.5rem }` would otherwise inflate the line box. */
.new-order-panel__hint--icon {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.new-order-panel__hint--icon i {
    font-size: 0.8125rem;
    line-height: 1;
    flex-shrink: 0;
}

/* Design `.form-section-opt`: the "(facultatif)" half of a caption is smaller and italic, where
   the shared class only mutes it. */
.new-order-panel .abena-v3-form__label-optional {
    font-size: 0.75rem;
    font-style: italic;
    margin-left: 0.375rem;
}

/* Design `.check-note` — why the renewal's inclusion box is disabled, inside its label. */
.new-order-panel__check-note {
    font-weight: 400;
    color: var(--abena-color-text-muted, var(--color-gray-500));
}

.admin-order-main-page .admin-order-list-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* The wrapper takes the space the toolbar leaves, the grid fills the wrapper. Unlike the
   customer list this wrapper holds the grid alone — the toolbar is its sibling — but the shape
   is kept identical so the two pages stay comparable. */
.admin-order-main-page__content > .admin-order-list-grid {
    flex: 1;
    min-height: 0;
}

.admin-order-main-page__content > .admin-order-list-grid > .k-grid {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
}

.admin-order-list-grid__empty {
    padding: 2rem;
    text-align: center;
    color: var(--color-gray-500);
}

/* ============================================================
   Order edit page (/order/edit/{id}) — v3 page header.

   This route hides the global top row (IsRedesignedOrderScreen in AbsMainLayout), so
   OrderEditTopbar renders `.abena-v3-top-bar-header--page` itself and the page needs the
   `.abs-page` reset, otherwise the header is inset by the default page padding and pushed
   down by its margin. The order VIEW screen still uses `.cde-edit-page` from
   Abena-commande.css and is untouched by everything here.
   ============================================================ */
.abs-page:has(> .order-edit-page) {
    padding: 0 !important;
    margin: 0;
    background-color: var(--sn-surface-subtle);
}

/* The page root owns its own height and the vertical scroll, rather than being flex-filled
   from the drawer. A flex chain cannot reach it: `.abs-page` (AbsPageLayout) is display:block
   / height:auto, and the drawer's body-region rule
   `.abs-left-bar > .k-drawer-container > .k-drawer-content > :nth-child(2)` — the one that
   hands out `flex: 1 1 auto` — only matches when the global top row renders as first child.
   This route hides that top row, so the page div is :nth-child(1) and never gets the flex,
   which left `.order-edit-page` at its content height with the drawer's white ground showing
   below it. Same calc() approach as .progression-plan-main-page and .rooms-config-page;
   --top-bar-height is 0px here because AbsMainLayout stamps `.no-topbar` on this route. */
.order-edit-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--top-bar-height));
    min-height: 0;
    width: 100%;

    /* TYPOGRAPHY — the prototype's --font-body is Gilroy; this app's --kendo-font-family is
       Roboto, so using it rendered every label in the wrong typeface (measured: "HT" 18.16px
       wide / 16px tall in Roboto against the prototype's 17.09 / 17).

       The prototype self-hosts Gilroy at 400, 600 and 700 ONLY — there is no Medium face. Its
       declared `font-weight: 500` therefore matches down to 400 and RENDERS REGULAR. This app's
       `Gilroy` family does declare a real 500 (Gilroy-Medium.woff2), so copying the prototype's
       500 literally would render Medium — heavier than the design. Every 500 in the prototype
       is reproduced here as 400; only its 600/700 runs get a heavier face.

       `Gilroy-Regular` (the named single-weight family) is used for regular text rather than
       `Gilroy` 400 — same choice, and for the same reason, as the order recap modal
       (.abena-v3-modal--order-recap) and the article details drawer. The smoothing pair mirrors
       the prototype's `body`; without it the same face renders with the heavier OS default. */
    --font-body: 'Gilroy', sans-serif;
    --font-body-regular: 'Gilroy-Regular', 'Gilroy', sans-serif;

    font-family: var(--font-body-regular);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fixed-height header above the scrolling body — never let it be squeezed by the flex
   algorithm when the body overflows. */
.order-edit-page > .abena-v3-top-bar-header--page {
    flex: 0 0 auto;
    padding-left: 32px;
    padding-right: 32px;
    border-bottom-color: #F5F5F5;
}

/* Left cluster: back › establishment dropdown › crumb › "Commande {id}" title. */
.order-edit-top-bar__lead {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

/* The standalone title carries a 1.5rem left padding; inside the lead cluster the dropdown
   already sits on the left, so drop it and let the lead's gap do the spacing. */
.order-edit-top-bar__lead .abena-v3-top-bar-header__title {
    padding-left: 0;
}

.order-edit-top-bar__lead .abena-v3-page-title {
    line-height: 21px;
}

/* Design `.nr-back`. */
.order-edit-top-bar__lead .abena-v3-top-bar-header__back {
    width: 32px;
    height: 32px;
    color: var(--sn-text);
}

/* Design `.topbar-client-selector`. `!important` answers Abena-TopBar.css. */
.order-edit-top-bar__lead .etablissement-list--topbar .k-picker {
    border-color: var(--sn-rail) !important;
    padding: 0 14px;
}

.order-edit-top-bar__lead .etablissement-list--topbar .topbar-estab-value__logo i,
.order-edit-top-bar__lead .etablissement-list--topbar .k-input-button {
    color: var(--abena-color-action-blue) !important;
}

/* Design `.topbar-crumb-sep`. */
.order-edit-top-bar__lead .topbar-breadcrumb-sep {
    color: #E0E0E0;
}

.order-edit-page .abena-v3-top-bar-header__actions {
    gap: 8px;
}

/* ---------- Order edit header CTAs ----------
   Geometry is the prototype's `.btn.btn-solid` (42px tall, 0 16px padding, 6px gap, 14px
   text); `.abena-v3-topbar-cta` supplies the height and the 12px radius but an 8px padding
   / 4px gap, so both are overridden here. Values are pinned in px on purpose: the app
   rescales the root font at width breakpoints, which would otherwise shrink these
   rem-derived sizes away from the prototype. Scoped to these buttons' own classes — the
   shared `.abena-v3-topbar-cta` used by Resident, Room and ProgressionPlan is left alone.

   `.order-catalog-cta` used to be pushed into the global top bar through the AbsTopRowHost
   outlet and was scoped to `.abs-topbar`; with that bar hidden on this route it lives in the
   page header, so the scope moved to `.order-edit-page`. */
.order-edit-page .order-catalog-cta,
.order-edit-page .order-purchase-order-cta {
    padding: 0 16px;
    gap: 6px;
    font-size: 14px;
}

/* Flat "Historique" button, sitting immediately to the right of "Ajouter des produits".
   Same 42px height as the CTAs so the action row shares one baseline. */
.order-edit-page .order-history-cta {
    min-height: 42px;
    height: 42px;
    padding: 0 16px;
    gap: 6px;
    font-size: 14px;
    border-radius: 12px;
    color: var(--sn-text);
}

.order-edit-page .order-history-cta i {
    font-size: var(--kendo-font-size-md);
    line-height: 1;
}

@media (max-width: 1150px) {
    .order-edit-page .order-purchase-order-cta > span,
    .order-edit-page .order-history-cta > span {
        display: none;
    }

    .order-edit-page .order-catalog-cta,
    .order-edit-page .order-purchase-order-cta,
    .order-edit-page .order-history-cta {
        padding: 0 12px;
    }
}

/* ============================================================================
   Order edit content.

   Every value below was read off the prototype's own stylesheet (its 10 inline <style>
   blocks, extracted rather than eyeballed) and mapped onto this app's tokens wherever one
   already carries the identical value — the prototype's --fg-primary #0D1740 is
   --abena-color-page-title, --fg-secondary #565D79 is --sn-text-muted, --color-primary-600
   #0044C2 is --abena-color-action-blue, --color-purple #8F49D4 is
   --abena-color-badge-purple-fg, --shadow-card #EDF1FB is --abena-shadow-card-glow.

   `.cmd-groups` is intentionally an empty box for now: the grouped order lines are the next
   slice of work. Its rules are still here so the surrounding geometry is final.

   All rules are scoped under `.order-edit-page` so nothing can reach the order VIEW screen,
   which still uses `.cde-edit-page` from Abena-commande.css.
   ============================================================================ */

/* The prototype's stylesheet opens with a global `*,*::before,*::after{box-sizing:border-box}`
   which this app does NOT have. Without carrying it over, every ported height + padding pair
   inflates — the same trap the catalog drawer hit (`.cat-tnode` came out 48px against 40px).
   Scoped to descendants of the page; the page root itself is excluded. */
.order-edit-page .cmd-layout *,
.order-edit-page .cmd-layout *::before,
.order-edit-page .cmd-layout *::after {
    box-sizing: border-box;
}

/* ---------- Layout ----------
   The 2rem page gutter is this app's (the header above is flush to the page edges, the body is not). */
.order-edit-page .cmd-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 2rem;
    flex: 1;
    min-height: 0;
    /* The drawer clips its own overflow, so this region owns the page scroll. It is also the
       scroll container the sidebar's `position: sticky` resolves against. */
    overflow-y: auto;
}

.order-edit-page .cmd-main {
    flex: 1;
    min-width: 0;
}

.order-edit-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* The top margin lines the first card up with the first product card, below the section title. */
.order-edit-page .cmd-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    margin-top: 88px;
}

/* The badge's inherited Gilroy-Regular has no 600 face, which the browser fakes. */
.order-edit-page .res-badge {
    font-family: var(--font-body);
}

/* ---------- Subheader ---------- */
.order-edit-page .cmd-subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* The view-mode toggle is the shared AbenaV3SegmentedControl (.abena-v3-seg-group in
   Abena-v3.css) — the prototype's `.btn-seg` geometry became that component's default. Only
   the weight is overridden: the component defaults to 500 (the design system's medium), but
   the prototype's Gilroy has no Medium face, so its `.btn-seg` renders Regular. See the
   typography note on .order-edit-page. */
.order-edit-page .abena-v3-seg {
    font-weight: 400;
}

.order-edit-page .cmd-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(0, 61, 125, 0.173);
    border-radius: 8px;
    background: #fff;
    width: 260px;
    flex-shrink: 0;
}

.order-edit-page .cmd-search i {
    font-size: 16px;
    line-height: 1;
    color: var(--sn-text-muted);
}

.order-edit-page .cmd-search input {
    border: none;
    background: transparent;
    flex: 1;
    font-family: var(--font-body-regular);
    font-size: 14px;
    color: var(--abena-color-page-title);
    outline: none;
    min-width: 0;
}

.order-edit-page .cmd-search input::placeholder {
    color: var(--sn-text-muted);
}

/* Design `.cmd-search` width on the shared grid search. */
.order-edit-page .cmd-subheader .abena-v3-grid-search {
    flex-basis: 260px;
    width: 260px;
}

/* ---------- Alerts (OrderAlertsPanel sits in the prototype's #cmd-alerts slot) ---------- */
/* `:has(> *)` rather than the prototype's `:not(:empty)`: OrderAlertsPanel renders nothing
   when the order has no error and no warnings, but Blazor still leaves component-boundary
   comment nodes in the div, and whether `:empty` ignores those is browser-dependent. This
   matches only when a real element is inside, so the 16px gap can't appear on a clean order. */
.order-edit-page #cmd-alerts:has(> *) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

/* Prototype `.drawer-recap.order-alert` — the shared box repainted in the error tint, as
   `<AbenaV3InfoBox Variant="Panel">`: the fill and the border come from the shared `--error`
   tint (identical values — `--abena-color-alert-error-bg` is `--abena-color-badge-red-bg` byte
   for byte, and its border is the design's 0.30 alpha). Only the grid the badge / message /
   cross / detail rows sit in is specific to this screen, and it stays page-scoped because the
   drawer's substitution bar shares `.badge-ico` but not this layout. The 0.22/0.18/0.10 alphas
   the design derives from the same hue have no token and stay literal. */
.order-edit-page .abena-v3-info-box--panel {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 3px;
    padding: 14px 16px;
    border-radius: 8px;
}

/* Design `.badge-ico.bi-error` as a 32px white square. The design declares it twice with the
   SAME body — once under `.order-alert`, once under `.cat-subst-bar` — so both scopes are listed
   here rather than restated. Not made global: `.badge-ico` is not a shared primitive in this app,
   and the order history panel declares its own 28px `bi-primary` variant.

   The drawer needs its own selector because SlidePanel teleports its body through a
   <SectionContent> into the layout's outlet, so it is NOT inside `.order-edit-page`. */
.order-edit-page .abena-v3-info-box--panel .badge-ico,
.order-catalog-drawer .cat-subst-bar .badge-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid rgba(187, 72, 65, 0.22);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(187, 72, 65, 0.10);
}

/* Alert only — the design gives these to the alert's `.badge-ico` and NOT to the substitution
   bar's, whose row is a plain flex line with no grid track to sit in. */
.order-edit-page .abena-v3-info-box--panel .badge-ico {
    grid-row: 1 / 2;
    margin-top: -1px;
}

.order-edit-page .abena-v3-info-box--panel .badge-ico i,
.order-catalog-drawer .cat-subst-bar .badge-ico i {
    font-size: 18px;
    /* The app's global `i { line-height: 1.5rem }` inflates the glyph's line box and pushes it
       off the square's centre. */
    line-height: 1;
    color: var(--abena-color-error);
}

.order-edit-page .oa-msg {
    grid-column: 2 / 3;
    padding-top: 4px;
    max-width: 68ch;
    font-family: var(--font-body-regular);
    font-size: 14px;
    line-height: 1.45;
    color: var(--abena-color-page-title);
    text-wrap: pretty;
}

.order-edit-page .oa-msg b {
    font-family: var(--font-body-bold);
    font-weight: 700;
    color: var(--abena-color-error);
}

/* Dismiss. `max-height` and `line-height` are pinned against the app's global
   `button { max-height: 3rem }` and `i { line-height: 1.5rem }`, both of which resize this. */
.order-edit-page .oa-x {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    max-height: none;
    margin-top: 2px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--abena-color-error);
    opacity: .6;
    cursor: pointer;
}

/* AbenaV3Button carries a min-height on every Size (Small is 30px); this dismiss is the design's
   24px square, so the height above needs the matching floor or the button grows. Theme=Neutral
   with FillMode=Flat is deliberate: it is the one pairing with no colour or :hover rule of its
   own, so the resting and hover styles here are left to win unopposed. */
.order-edit-page .abena-v3-btn.oa-x {
    min-height: 24px;
}

.order-edit-page .oa-x:hover {
    opacity: 1;
    background: rgba(187, 72, 65, 0.10);
}

.order-edit-page .oa-x i {
    font-size: 16px;
    line-height: 1;
}

/* Design `.oa-list.open`. Always open here: the panel has no "voir le détail" toggle — the
   static prototypes render the list expanded and the articles are the point of the panel. */
.order-edit-page .oa-list {
    grid-column: 2 / 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(187, 72, 65, 0.22);
}

.order-edit-page .oa-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border: 1px solid rgba(187, 72, 65, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
    font-family: var(--font-body-regular);
    font-size: 13px;
    color: var(--abena-color-page-title);
}

.order-edit-page .oa-item-main,
.order-catalog-drawer .oa-item-main {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-edit-page .oa-item-main b,
.order-catalog-drawer .oa-item-main b {
    font-family: var(--font-body-bold);
    font-weight: 700;
}

.order-edit-page .oa-ref,
.order-catalog-drawer .oa-ref {
    font-variant-numeric: tabular-nums;
    color: var(--sn-text-muted);
}

/* Conditioning + ordered quantity, as badges. Skin ported verbatim from the design's `.oa-qty`
   (added to html-and-css.html in the 28/08 export):

       .oa-qty{font-family:var(--font-body);font-size:12px;font-weight:600;
               color:var(--fg-secondary);background:rgba(255,255,255,.7);
               border:1px solid rgba(187,72,65,.18);border-radius:var(--radius-full);
               padding:1px 8px;white-space:nowrap}

   The border is the same `rgba(187,72,65,.18)` as `.oa-item`'s, and `--fg-secondary` #565D79 is
   --sn-text-muted here.

   DELIBERATE DIVERGENCE — do not "restore" this to the prototype. The design's rule sets no
   `display` and no `height`, so the badge is as tall as the inherited line-height and the text sits
   on its baseline inside it rather than centred — visibly off in the prototype too. Requested
   changed on 2026-08-28. Fixed with the centring mechanics the design's OWN pills already use
   (`.pill`: inline-flex + align-items:center + fixed height; likewise `.cmd-price-pill`), at
   `.pill-sm`'s 22px — which is also what this badge already measured, so rows do not shift.
   `line-height: 1` keeps the inner line box tight so `align-items` centres the glyphs and not a
   line box inflated by the app's global line-height. */
.order-edit-page .oa-qty,
.order-catalog-drawer .oa-qty {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(187, 72, 65, 0.18);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.7);
    /* .oa-item sets 13px; the badge is 12px/600, the design's Gilroy at semibold. */
    font-family: var(--font-body-semibold);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: var(--sn-text-muted);
    white-space: nowrap;
}

/* Design `.oa-actions.inline` — the single retry of the "aucun prix disponible" panel, which
   has no article list to hang it off. */
.order-edit-page .oa-actions {
    grid-column: 2 / 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.order-edit-page .oa-actions--inline {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    align-self: center;
    margin-top: 0;
}

/* Design `.oa-ignore` — a plain underlined link, not a button. */
.order-edit-page .oa-ignore {
    padding: 0 2px;
    max-height: none;
    border: none;
    background: transparent;
    font-family: var(--font-body-regular);
    font-size: 13px;
    color: var(--abena-color-error);
    opacity: .75;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}

.order-edit-page .oa-ignore:hover:not(:disabled) {
    opacity: 1;
}

/* Design `.btn.btn-sm.btn-outline-error` = AbenaV3Button Error/Outline/Small, which is what
   renders it — this rule only pins the prototype's exact geometry on top, through the
   component's `Class` passthrough.

   An earlier version of this comment claimed "this app has no `.btn` primitive". That was
   wrong, and it is why this screen grew a pile of hand-rolled `<button>` markup: the primitive
   is `AbenaV3Button` (`Framework/AbenaSoinsV3.UI.Core/Components/AbenaV3/`), whose class names
   are `abena-v3-btn--*` rather than the prototype's `.btn--*`. Reach for it first; use `Class`
   for whatever prototype geometry it does not already give you. */
.order-edit-page .oa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    max-height: none;
    padding: 0 12px;
    border: 1px solid var(--abena-color-error);
    border-radius: 8px;
    background: transparent;
    font-family: var(--font-body-bold);
    font-size: 13px;
    font-weight: 700;
    color: var(--abena-color-error);
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s;
}

.order-edit-page .oa-btn:hover:not(:disabled) {
    background: rgba(187, 72, 65, 0.08);
}

.order-edit-page .oa-btn i {
    font-size: 14px;
    line-height: 1;
}

.order-edit-page .oa-btn:disabled,
.order-edit-page .oa-ignore:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------- "Actualisation des prix" overlay ----------
   Prototype `#price-refresh-modal` (`.success-overlay` + `.success-card` + `.px-icon`). Shown
   while a "Réessayer" recalculates the order. Fixed to the viewport, so it does not matter that
   the panel renders it inside `#cmd-alerts`; the z-index sits above the drawer and below the
   Telerik notification stack. */
.order-edit-page .order-price-refresh {
    position: fixed;
    inset: 0;
    z-index: 4300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 23, 64, 0.45);
}

.order-edit-page .order-price-refresh__card {
    width: 440px;
    max-width: 100%;
    padding: 32px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(13, 23, 64, 0.24);
    text-align: center;
}

.order-edit-page .order-price-refresh__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 9999px;
    background: var(--abena-color-badge-blue-bg);
    color: var(--abena-color-action-blue);
    font-size: 26px;
    animation: order-price-refresh-pulse 1.6s ease-in-out infinite;
}

.order-edit-page .order-price-refresh__icon i {
    display: block;
    line-height: 1;
    animation: order-price-refresh-spin 1s cubic-bezier(.65, 0, .35, 1) infinite;
}

.order-edit-page .order-price-refresh__title {
    margin-bottom: 6px;
    font-family: "Rounded Mplus 1c Bold", "Rounded Mplus 1c", Gilroy-Bold, sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--abena-color-page-title);
}

.order-edit-page .order-price-refresh__text {
    font-family: var(--font-body-regular);
    font-size: 14px;
    line-height: 1.6;
    color: var(--sn-text-muted);
}

@keyframes order-price-refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes order-price-refresh-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 68, 194, 0.14);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 68, 194, 0);
    }
}

/* ---------- Groups region ----------
   EMPTY FOR NOW — see the file header. It still reserves the column so the sidebar's sticky
   offset and the page's scroll behaviour are the final ones. */
.order-edit-page .cmd-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 12rem;
}

/* ---------- Sidebar cards ----------
   Prototype `.card`: surface, 1px --border-default, --radius-lg (12px), --shadow-card. */
.order-edit-page .card {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 61, 125, 0.173);
    border-radius: 12px;
    box-shadow: 0 2px 10px 0 var(--abena-shadow-card-glow);
}

.order-edit-page .cmd-info-card {
    padding: 18px 20px;
}

.order-edit-page .cmd-recap-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.order-edit-page .cmd-sub-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Prototype writes this offset inline (`style="margin-top:8px"`) on the pill row. */
.order-edit-page .cmd-sub-row--pills {
    margin-top: 8px;
    flex-direction: column;
    align-items: flex-start;
}

.order-edit-page .cmd-sub-num {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--abena-color-page-title);
}

.order-edit-page .cmd-sub-num span {
    color: var(--sn-text-muted);
    font-weight: 400;
    margin-right: 6px;
}

.order-edit-page .cmd-sub-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--sn-text-muted);
}

/* The pills carry a leading icon instead of the dot (AbenaV3StatusBadge Icon parameter), so
   only its size needs pinning: the prototype writes `font-size:13px` inline on each, and the
   app's global `i { line-height: 1.5rem }` would otherwise inflate the 24px pill. */
.order-edit-page .cmd-sub-row .res-badge i {
    font-size: 13px;
    line-height: 1;
    /* Never squeezed out when the label is truncated. */
    flex-shrink: 0;
}

/* A status label is free text — an order status carries the operator's comment — and `.res-badge`
   is a `white-space: nowrap` inline-flex with no max-width, so a long one ran straight out of the
   320px card. The badge is capped at the row's width and the LABEL is ellipsized rather than the
   badge: `text-overflow` on the flex container itself would never reach its text, and truncating
   the label keeps the icon in place. `overflow: hidden` also drops the flex item's automatic
   minimum size, which is what lets it shrink at all.

   Scoped to this row on purpose: the badge is shared with the German patients grid, whose cells
   size differently, and this must not silently change how they wrap. */
.order-edit-page .cmd-sub-row .res-badge {
    max-width: 100%;
    min-width: 0;
}

.order-edit-page .cmd-sub-row .res-badge__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Recap card ---------- */
.order-edit-page .block-title {
    padding: 2px 0 4px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--abena-color-page-title);
}

.order-edit-page .cmd-tot-caption {
    font-size: 13px;
    color: var(--sn-text-muted);
    display: block;
    margin-bottom: 8px;
}

.order-edit-page .cmd-loyalty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(143, 73, 212, .07);
    border: 1px solid rgba(143, 73, 212, .24);
}

.order-edit-page .cmd-loyalty .cl-ic {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(143, 73, 212, .14);
    color: var(--abena-color-badge-purple-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.order-edit-page .cmd-loyalty .cl-ic i {
    line-height: 1;
}

.order-edit-page .cmd-loyalty .cl-t {
    display: block;
    font-size: 12px;
    color: var(--sn-text-muted);
}

/* --font-display in the prototype is 'M PLUS Rounded 1c'; this app bundles it as
   "Rounded Mplus 1c Bold", the face `.abena-v3-page-title` already uses. */
.order-edit-page .cmd-loyalty .cl-v {
    font-family: "Rounded Mplus 1c Bold", var(--kendo-font-family);
    font-size: 17px;
    font-weight: 700;
    color: var(--abena-color-badge-purple-fg);
}

.order-edit-page .cmd-recap-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    /* The prototype declares 500 here; with no Medium face it renders Regular — see the
       typography note on .order-edit-page. */
    font-family: var(--font-body-regular);
    font-weight: 400;
    font-size: 14px;
    color: var(--sn-text-muted);
}

.order-edit-page .cmd-recap-line b {
    font-family: var(--font-body);
    color: var(--abena-color-page-title);
    font-weight: 600;
}

.order-edit-page .cmd-pts-row b,
.order-edit-page .cmd-pts-row.earn b {
    color: var(--abena-color-badge-purple-fg);
}

.order-edit-page .cmd-recap-sep {
    height: 1px;
    background: var(--sn-rail);
    margin: 4px 0;
}

.order-edit-page .cmd-recap-ttc {
    padding-top: 10px;
}

.order-edit-page .cmd-recap-ttc span {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--abena-color-page-title);
}

.order-edit-page .cmd-recap-ttc b {
    font-size: 16px;
    color: var(--abena-color-action-blue);
}

.order-edit-page .cmd-disclaimer {
    font-size: 12px;
    color: var(--sn-text-muted);
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 10px;
}

.order-edit-page .cmd-disclaimer i {
    line-height: 1.45;
}

/* ---------- "Valider la commande" ----------
   Prototype `.btn` + `.btn-solid`, with the inline `width:100%;justify-content:center;
   margin-top:12px` the compose screen sets on this one. A plain button rather than
   AbenaV3Button: `.abena-v3-btn` pins its own height/padding/radius, all of which would have
   to be fought back to these values. The app's global `button{max-height:3rem}` is defeated
   explicitly — it resolves 42px down at narrow widths. */
.order-edit-page .cmd-validate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 42px;
    max-height: none;
    margin-top: 12px;
    padding: 0 16px;
    border: 1px solid var(--abena-color-action-blue);
    border-radius: 12px;
    background: var(--abena-color-action-blue);
    color: #fff;
    /* Prototype `.btn` declares 500; no Medium face, so it renders Regular. */
    font-family: var(--font-body-regular);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}

.order-edit-page .cmd-validate i {
    font-size: 16px;
    line-height: 1;
}

.order-edit-page .cmd-validate:hover:not(:disabled) {
    background: #0535CE;
    border-color: #0535CE;
}

.order-edit-page .cmd-validate:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ============================================================================
   Order catalog drawer (OrderCatalogDrawer)
   Ported from the prototype's `.drawer.wide` catalog — every value below was read off
   the live prototype (see tasks/NEW_ORDER-catalog-drawer/proto/), mapped onto this app's
   tokens where one already carries the same colour. All rules are scoped under
   `.order-catalog-drawer` so nothing here can reach the other SlidePanel consumers.
   ============================================================================ */

/* The design's stylesheet has a global `* { box-sizing: border-box }`; this app does not.
   Without carrying it over, every ported height + padding pair inflates: `.cat-tnode` came out
   48px against the design's 40px because min-height sized the content box and the 4px vertical
   padding stacked on top. Scoped to the drawer so no other screen is affected; the panel root
   itself is excluded (only descendants match), so its 1040px width is untouched. */
.order-catalog-drawer *,
.order-catalog-drawer *::before,
.order-catalog-drawer *::after {
    box-sizing: border-box;
}

/* ---------- Typography base ----------
   `.abena-v3-slide-panel` is one of the surfaces that opts into `--abena-v3-font` (Roboto)
   at 16px, but the design's catalogue runs on Gilroy at 14px. Roboto is both wider and
   differently proportioned, so every ported font-size landed on the wrong glyphs and the
   two screens read as different products side by side. Re-based here, scoped to this
   drawer, so the other SlidePanel consumers keep Roboto.

   Weight -> family mapping is explicit on purpose: this app ships Gilroy as one family per
   weight, so `font-weight` alone would only synthesise. `Gilroy-Regular` / `Gilroy-Semibold`
   / `Gilroy-Bold` name the faces the design uses (its webfont ships 400/600/700).
   Measured against the design: 'ABENA San 9, Premium 37x73cm' @14px is 201.02px in both
   at regular, 203.7px at semibold, 205.0px at bold. */
.order-catalog-drawer {
    font-family: var(--font-body-regular);
    font-size: 0.875rem; /* 14px — design body */
}

/* Form controls don't inherit typography by default. */
.order-catalog-drawer button,
.order-catalog-drawer textarea {
    font-family: inherit;
}

/* Abena-main.css declares `input, select { font-family: var(--primary-font) !important }`
   (Gilroy-Medium), which no amount of specificity beats — hence the !important here. It is
   deliberately NOT extended to `button`: that would outrank the per-weight families set on
   the footer CTA below and leave it as a synthesised bold. */
.order-catalog-drawer input,
.order-catalog-drawer select {
    font-family: inherit !important;
}

/* Design `.drawer-body.pad0` — the split pane manages its own padding. */
.order-catalog-drawer .abena-v3-slide-panel__body {
    padding: 0;
    overflow: hidden;
    gap: 0;
}

/* Fills whatever the body has left — `height: 100%` would overflow once the substitution bar
   is rendered above it. The body is already a flex column, so this is equivalent otherwise. */
.order-catalog-drawer .cat-split {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ---------- Substitution bar ---------- */

/* Design `.cat-subst-bar` — which article the drawer is finding a replacement for. Sits above
   the split rather than in the header, because SlidePanel owns the header. */
.order-catalog-drawer .cat-subst-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* 12px */
    flex-shrink: 0;
    padding: 0.75rem 1.5rem; /* 12px 24px */
    background: rgba(187, 72, 65, 0.12);
}

.order-catalog-drawer .cat-subst-main {
    min-width: 0;
}

.order-catalog-drawer .cat-subst-t {
    font-size: 0.75rem; /* 12px */
    font-weight: 500;
    color: var(--sn-text-muted);
}

/* Only the type of the value line. Its flex row, its 10px gap and its bold designation come from
   `.oa-item-main`, which this element also carries — see the markup note in OrderCatalogDrawer. */
.order-catalog-drawer .cat-subst-v {
    font-size: 0.875rem;
    color: var(--abena-color-page-title);
    /* `.oa-item-main` carries `min-width: 200px` so an alert row keeps its buttons on the same
       line. The bar has no buttons inside the value line and must be able to shrink, so it is
       dropped here. Same specificity as the shared rule, later in the file, so this wins. */
    min-width: 0;
}

.order-catalog-drawer .cat-subst-cancel {
    margin-left: auto;
    flex-shrink: 0;
    height: 2.625rem; /* 42px */
    max-height: none; /* the app's global `button { max-height: 3rem }` is rem-scaled */
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: transparent;
    color: var(--color-navy);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: normal;
    cursor: pointer;
    white-space: nowrap;
}

.order-catalog-drawer .cat-subst-cancel:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ---------- Hierarchy tree ---------- */

.order-catalog-drawer .cat-tree {
    width: 14.75rem; /* 236px */
    flex-shrink: 0;
    border-right: 1px solid var(--sn-rail); /* #DFE3E8 — design --border-divider */
    padding: 1.5rem 1.25rem; /* 24px 20px */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.order-catalog-drawer .cat-tree-hd {
    /* Design uses --font-display here, same face as the panel title. */
    font-family: "Rounded Mplus 1c Bold", "Rounded Mplus 1c", Gilroy-Bold, sans-serif;
    font-weight: 700;
    font-size: 0.8125rem; /* 13px — design --font-size-sm */
    color: var(--sn-text-muted);
    padding: 0 0.125rem 0.625rem;
}

.order-catalog-drawer .cat-tree-nodes {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    margin: 0 -0.5rem;
}

/* Design `.cat-tree-sep`. */
.order-catalog-drawer .cat-tree-sep {
    height: 1px;
    background: var(--sn-rail); /* #DFE3E8 — design --border-divider */
    margin: 0.5rem 0.625rem; /* 8px 10px */
}

.order-catalog-drawer .cat-tree-empty {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    color: var(--sn-text-muted);
}

.order-catalog-drawer .cat-tnode {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.5rem; /* 40px — design .cat-tnode */
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--sn-text);
}

.order-catalog-drawer .cat-tnode:hover {
    background: var(--sn-row-hover);
}

.order-catalog-drawer .cat-tnode.active {
    background: rgba(0, 68, 194, 0.1); /* design --tint-primary */
    color: var(--abena-color-action-blue);
    font-family: var(--font-body-semibold);
    font-weight: 600;
}

/* Level 1 carries a caret column the design's flat list has no equivalent for, so the row's
   left inset is tightened below the design's 10px to buy the label back some width. The 8px
   `.cat-tnode` gap is the design's label-to-pill spacing and is deliberately NOT reduced —
   only the caret's own trailing space shrinks, via the negative margin on `.cat-tnode-caret`
   below. Net: the label starts at 26px instead of 38px. */
.order-catalog-drawer .cat-tnode--l1 {
    padding-left: 0.375rem; /* 6px */
}

/* Level 2 sits under its parent with the caret column's worth of indent, and stays regular
   weight and muted so the semibold level-1 rows read as the headings of the list. */
.order-catalog-drawer .cat-tnode--l2 {
    padding-left: 2.125rem; /* 34px */
    font-size: 0.875rem;
    color: var(--sn-text-muted);
}

.order-catalog-drawer .cat-tnode-caret {
    /* 16px box wraps the 16px glyph with no slack; the negative margin trims the row's 8px
       gap down to 4px on this side only, leaving the label-to-pill gap at the design's 8px.
       `.cat-tnode-caret--empty` shares this class, so childless rows stay aligned. */
    width: 1rem;
    margin-right: -0.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    /* Collapsed points right, expanded points down — the design rotates one angle-down glyph by
       -90deg rather than swapping it, which is why there is no angle-right in the markup. It
       used to flip between down and up. */
    color: var(--sn-text-muted);
    transform: rotate(-90deg);
    transition: transform 120ms ease;
}

/* The caret is an AbenaV3Button, which floors every Size at a min-height (Small is 30px); this one
   is the design's 20px box, so the height above needs the matching floor. `--empty` is a span and
   never picks this up, which is harmless — it has no min-height to beat. */
.order-catalog-drawer .abena-v3-btn.cat-tnode-caret {
    min-height: 1.25rem; /* 20px */
}

.order-catalog-drawer .cat-tnode-caret i {
    font-size: 0.9375rem; /* 15px — the app's global `i` forces 1rem */
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` overflows the 20px box */
}

.order-catalog-drawer .cat-tnode-caret.is-open {
    transform: none;
}

/* The selected row tints everything in it, caret included. */
.order-catalog-drawer .cat-tnode.active .cat-tnode-caret {
    color: inherit;
}

.order-catalog-drawer .cat-tnode-caret--empty {
    cursor: default;
}

/* A real <button>, so Enter and Space select the node natively: the row keeps its own click
   for the mouse and the label's click bubbles to it. The resets strip the UA button chrome. */
.order-catalog-drawer .cat-tnode-lb {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

/* The ring goes on the row, so the whole node reads as focused rather than just its label. */
.order-catalog-drawer .cat-tnode:has(> .cat-tnode-lb:focus-visible) {
    outline: 0.125rem solid var(--abena-color-action-blue);
    outline-offset: -0.125rem;
}

.order-catalog-drawer .cat-tnode-lb:focus-visible {
    outline: none;
}

/* Fixed-height rows mean long French hierarchy names ellipsis rather than wrap; the node
   carries a `title` with the full text. */
/* Design lets the node icon inherit the node's own type size (14px, 13px on a level-2 node)
   and line box. The app's globals force 1rem with a 1.5rem line-height, which rendered the
   glyph a size larger than the design's and grew `.cat-tnode-lb` from the design's 17px to
   24px. `normal` is what the design computes — not the `line-height: 1` used elsewhere in
   this file — so the label box lands on 17px exactly. */
.order-catalog-drawer .cat-tnode-lb i {
    font-size: inherit;
    line-height: normal;
}

/* Design: a level-1 hierarchy (and the "all products" reset above it) is semibold; only its
   level-2 children stay regular. */
.order-catalog-drawer .cat-tnode:not(.cat-tnode--l2) .cat-tnode-tx {
    font-family: var(--font-body-semibold);
    font-weight: 600;
}

.order-catalog-drawer .cat-tnode-tx {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Design `.pill.pill-neutral`, and its inverted form on the active node. */
.order-catalog-drawer .cat-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 1.5rem; /* 24px — design .pill */
    gap: 0.3125rem; /* 5px */
    padding: 0 0.625rem; /* 10px */
    border-radius: 999rem;
    font-size: 0.75rem;
    font-family: var(--font-body-semibold);
    font-weight: 600;
    background: var(--sn-border); /* #EFF1F4 — design .pill-neutral */
    color: var(--sn-text);
}

.order-catalog-drawer .cat-tnode.active .cat-pill {
    background: var(--bg-surface);
    color: var(--abena-color-action-blue);
}

/* ---------- Right pane ---------- */

.order-catalog-drawer .cat-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem 2rem; /* 24px 32px */
}

.order-catalog-drawer .cat-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.order-catalog-drawer .cat-label {
    font-size: 0.875rem;
    color: var(--color-label); /* design .rp-label */
    line-height: 1.42;
}

/* Design `.aff-search`. Both boxes are the shared AbsSearchInput; `.cat-search` and
   `.cat-tree-search` are wrappers that give it the design's geometry, the same way
   `.abena-v3-slide-panel__search` (Abena-v3.css) does for the room panel. The tree's box is
   the same control — only its margin below differs. */
.order-catalog-drawer .cat-search .search-with-icon,
.order-catalog-drawer .cat-tree-search .search-with-icon {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 2.3125rem; /* 37px — design .aff-search */
    border: 1px solid #E0E0E0; /* design .aff-search */
    border-radius: 0.5rem;
    background: var(--bg-surface);
    overflow: hidden;
}

.order-catalog-drawer .cat-search .search-with-icon:focus-within,
.order-catalog-drawer .cat-tree-search .search-with-icon:focus-within {
    border-color: var(--abena-color-action-blue);
    box-shadow: 0 0 0 3px rgba(0, 68, 194, 0.12);
}

/* Telerik's own textbox chrome — the wrapper above owns the border and the background. */
.order-catalog-drawer .cat-search .search-with-icon > span,
.order-catalog-drawer .cat-search .search-with-icon .k-input,
.order-catalog-drawer .cat-tree-search .search-with-icon > span,
.order-catalog-drawer .cat-tree-search .search-with-icon .k-input {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
}

.order-catalog-drawer .cat-search .search-with-icon i,
.order-catalog-drawer .cat-tree-search .search-with-icon i {
    left: 0.875rem; /* 14px */
    font-size: 1rem;
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
    color: var(--abena-color-action-blue);
}

.order-catalog-drawer .cat-search .search-with-icon .k-input-inner,
.order-catalog-drawer .cat-tree-search .search-with-icon .k-input-inner {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: 100% !important;
    /* left 40px = the 14px inset + the 16px glyph + the design's 10px gap */
    padding: 0 0.875rem 0 2.5rem !important;
    /* Beats the global `.search-with-icon .k-input-inner { font-family: var(--kendo-font-family) }`
       in Abena-v3.css: this drawer is Gilroy, not Roboto. */
    font-family: inherit !important;
    font-size: 0.875rem;
    color: var(--sn-text);
}

/* `light-placeholder` (AbsSearchInput's own class, styled in Abena-room.css) renders the
   placeholder in "Gilroy" at weight 300 — a different face from the drawer's Gilroy-Regular.
   Pinned back to the field's own type so the placeholder matches the text it stands in for. */
.order-catalog-drawer .cat-search .search-with-icon .k-input-inner::placeholder,
.order-catalog-drawer .cat-tree-search .search-with-icon .k-input-inner::placeholder {
    font-family: inherit;
    font-weight: inherit;
    color: var(--sn-text-muted);
    opacity: 1;
}

.order-catalog-drawer .cat-tree-search {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

/* ---------- Tools row ---------- */

.order-catalog-drawer .cat-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.875rem;
    flex-shrink: 0;
}

.order-catalog-drawer .cat-tools-lb {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sn-text-muted);
}

/* Design `.filter-btn` / `.filter-btn.active` — mutually exclusive segments, "Tous" included,
   so exactly one is always pressed. This is the shared AbenaV3SegmentedControl
   (.abena-v3-seg-group / .abena-v3-seg in Abena-v3.css); only the geometry is overridden,
   because the design's `.filter-btn` is 37px/14px where the component defaults to the order
   subheader's 34px/13px. The counts are plain parenthesised text inside the label —
   `Favoris (2)` — not a badge, exactly as the design writes them. */
.order-catalog-drawer .abena-v3-seg-group {
    gap: 0.5rem; /* 8px — the gap the chips inherited from .cat-tools */
}

.order-catalog-drawer .abena-v3-seg {
    gap: 0.4375rem; /* 7px */
    height: 2.3125rem; /* 37px */
    padding: 0 0.875rem;
    font-size: 0.875rem; /* 14px — design .filter-btn */
    font-weight: 500;
}

/* `:not(.is-active)`, not a bare `.abena-v3-seg`: this file loads after Abena-v3.css and would
   otherwise tie with `.abena-v3-seg.is-active` on specificity and win on source order, leaving
   the pressed segment grey-on-blue. */
.order-catalog-drawer .abena-v3-seg:not(.is-active) {
    color: var(--sn-text-muted);
}

.order-catalog-drawer .abena-v3-seg i {
    font-size: 1rem;
}

/* The design tints the border, not the background, on hover. */
.order-catalog-drawer .abena-v3-seg:hover:not(.is-active) {
    background: var(--bg-surface);
    border-color: var(--sn-text-muted);
    color: var(--abena-color-page-title);
}

/* Group separators — design `.cat-group-lb`. */
.order-catalog-drawer .cat-group-lb {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.75rem;
    font-family: var(--font-body-semibold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.42; /* 17px — this Gilroy-Semibold file's normal line box is 2px shorter */
    color: var(--sn-text-muted);
    padding: 0.375rem 0.125rem 0; /* design .cat-group-lb — the 8px below is the .cat-rows gap */
}

.order-catalog-drawer .cat-group-lb i {
    font-size: 0.875rem;
    line-height: 1;
    color: var(--abena-color-action-blue);
}

/* Design `.cat-tools-check` — the unreferenced-articles toggle. Deliberately not a chip: it
   widens the catalogue instead of narrowing it, so it combines with whichever chip is pressed. */
.order-catalog-drawer .cat-tools-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.375rem; /* 6px */
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--abena-color-page-title);
    cursor: pointer;
    user-select: none;
}

.order-catalog-drawer .cat-tools-check input {
    width: 1.125rem; /* 18px */
    height: 1.125rem;
    margin: 0;
    accent-color: var(--abena-color-action-blue);
    cursor: pointer;
}

.order-catalog-drawer .cat-tools-count {
    margin-left: auto;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sn-text-muted);
}

/* ---------- Rows ---------- */

.order-catalog-drawer .cat-rows {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    margin-top: 1rem;
    /* Design .cat-rows: the 8px gap spaces the rows AND the group labels between them, so the
       label needs no bottom padding of its own. */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-catalog-drawer .cat-row {
    display: grid;
    /* Design is 1fr / 120px / 80px / 198px. The conditioning column is widened to 10rem here:
       the design's 120px was sized for "Carton de 112 pc", but ToLocalizedString() renders the
       app's full unit names ("Carton(s) de 100 Pièce(s)"), which ellipsised away the quantity —
       the part that actually matters. Actions were 198px for two 34px buttons plus the
       stepper; a third button (article details) adds +34px +6px gap = 238px. */
    grid-template-columns: minmax(0, 1fr) 10rem 5rem 12.375rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 61, 125, 0.173); /* design .cat-row */
    border-radius: 0.5rem;
    background: var(--bg-surface);
    transition: border-color 120ms ease, background 120ms ease;
}

.order-catalog-drawer .cat-row:hover {
    border-color: var(--abena-color-action-blue);
}

.order-catalog-drawer .cat-row.is-added {
    background: rgba(0, 68, 194, 0.04);
}

.order-catalog-drawer .cat-row--placeholder {
    background: var(--sn-surface-subtle);
    border-color: var(--sn-border);
}

.order-catalog-drawer .cat-rows-empty {
    padding: 2rem;
    text-align: center;
    color: var(--sn-text-muted);
}

.order-catalog-drawer .cat-row-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.order-catalog-drawer .cat-row-desig {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.order-catalog-drawer .cat-desig {
    font-family: var(--font-body-semibold);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--abena-color-page-title);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-catalog-drawer .cat-row-ref {
    font-size: 0.8125rem;
    color: var(--sn-text-muted);
}

.order-catalog-drawer .cat-tag-nonref {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.6875rem; /* 11px */
    font-family: var(--font-body-semibold);
    font-weight: 600;
    color: var(--abena-color-badge-yellow-fg, #8A6100);
    background: rgba(212, 159, 0, 0.16);
    border-radius: 999rem;
    padding: 0.0625rem 0.5rem;
}

.order-catalog-drawer .cat-row-cond {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.order-catalog-drawer .cat-cond-main {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sn-text);
}

.order-catalog-drawer .cat-cond-sub {
    font-size: 0.75rem;
    color: var(--sn-text-muted);
}

.order-catalog-drawer .cat-cond-main,
.order-catalog-drawer .cat-cond-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-catalog-drawer .cat-row-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    /* Design `.cat-row-price`. The euro price is a plain span that `text-align` alone put on the
       right, but the points cost is an inline-flex badge: without this it stretches to the cell
       width and its icon+figure lay out from the left edge. */
    align-items: flex-end;
    gap: 0.0625rem;
}

.order-catalog-drawer .cat-price-val {
    font-size: 0.875rem;
    font-family: var(--font-body-bold);
    font-weight: 700;
    color: var(--abena-color-page-title);
    white-space: nowrap;
}

.order-catalog-drawer .cat-row.is-added .cat-price-val {
    color: var(--abena-color-action-blue);
}

/* Design `.cmd-pts-cost` — a PLV article's cost in loyalty points, sitting where the euro
   price goes. Display face + 700 like the design; the trailing unit ("pts") is the design's
   `.u`: one step down at 12px and semibold. `--abena-color-plv-purple` is the design's
   `--color-purple` (#8F49D4), already used by the loyalty badges elsewhere. */
/* ---------- Loyalty panel (PLV filter) ---------- */

/* Design `.cat-loyalty` — the balance and what is left of it, above a list where every row is
   priced in points. Only rendered under the PLV filter. */
.order-catalog-drawer .cat-loyalty {
    display: flex;
    align-items: center;
    gap: 0.875rem; /* 14px */
    flex-shrink: 0;
    margin-top: 0.75rem; /* 12px — `.cat-rows` keeps its own 16px below */
    padding: 0.75rem 0.875rem; /* 12px 14px */
    border: 1px solid rgba(143, 73, 212, 0.24);
    border-radius: 0.5rem;
    background: rgba(143, 73, 212, 0.07);
}

.order-catalog-drawer .cat-loyalty__ic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.375rem; /* 38px */
    height: 2.375rem;
    border-radius: 0.5rem;
    background: rgba(143, 73, 212, 0.14);
}

.order-catalog-drawer .cat-loyalty__ic i {
    font-size: 1.25rem; /* 20px */
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
    color: var(--color-violet);
}

.order-catalog-drawer .cat-loyalty__stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem; /* 2px */
    min-width: 0;
}

.order-catalog-drawer .cat-loyalty__t {
    font-size: 0.875rem;
    color: var(--sn-text-muted);
}

/* The rounded face the drawer already uses for a points price, so the panel's figures and the
   rows' costs read as the same currency. */
.order-catalog-drawer .cat-loyalty__v {
    font-family: "Rounded Mplus 1c Bold", "Rounded Mplus 1c", Gilroy-Bold, sans-serif;
    font-size: 1.1875rem; /* 19px */
    line-height: normal;
    color: var(--color-violet);
}

.order-catalog-drawer .cat-loyalty__sep {
    flex: 0 0 auto;
    align-self: stretch;
    width: 1px;
    background: rgba(143, 73, 212, 0.28);
}

.order-catalog-drawer .cat-pts-cost {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem; /* 4px */
    font-family: "Rounded Mplus 1c Bold", "Rounded Mplus 1c", Gilroy-Bold, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-violet);
    white-space: nowrap;
}

.order-catalog-drawer .cat-pts-cost i {
    font-size: 0.875rem;
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
}

.order-catalog-drawer .cat-pts-u {
    font-size: 0.75rem; /* 12px — design `.cmd-pts-cost .u` */
    font-family: var(--font-body-semibold);
    font-weight: 600;
}

/* Design `.cmd-pts-rate` — points earned by a non-PLV article, stacked under the price and
   right-aligned with it. Body face here, not the display face the points COST uses: the design
   sets no font-family on this one, so it inherits. */
.order-catalog-drawer .cat-pts-rate {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    gap: 0.25rem; /* 4px */
    margin-top: 0.3125rem; /* 5px */
    padding: 0.1875rem 0.625rem; /* 3px 10px */
    border-radius: 999rem;
    font-size: 0.6875rem; /* 11px */
    font-family: var(--font-body-bold);
    font-weight: 700;
    color: var(--color-violet);
    background: rgba(143, 73, 212, 0.1);
    white-space: nowrap;
}

.order-catalog-drawer .cat-pts-rate i {
    font-size: 0.6875rem; /* 11px */
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
}

/* Design `.cat-row.pts-block` — a PLV article the loyalty balance cannot cover. Visual only:
   the stepper stays usable and the order validation is what actually refuses the order, so a
   user who is about to top up their balance is not locked out of building the basket. */
.order-catalog-drawer .cat-row--pts-blocked {
    opacity: 0.72;
}

.order-catalog-drawer .cat-price-unit {
    font-size: 0.75rem;
    color: var(--sn-text-muted);
    white-space: nowrap;
}

/* ---------- Row actions ---------- */

.order-catalog-drawer .cat-row-actions {
    display: grid;
    grid-template-columns: 2.125rem 2.125rem auto; /* 34px 34px */
    align-items: center;
    gap: 0.375rem;
    justify-content: end;
}

/* Design `.ord-act-btn`: revealed on row hover, except a favourite which always shows. The design
   literally reuses `ord-act-btn` here (see tasks/NEW_ORDER-catalog-drawer/proto), so the resting
   colour is left to the AbenaV3Button Neutral theme exactly as the order line's are — that is
   --sn-text-muted, the design's --color-gray-500. Restating --sn-text here is what made the drawer
   icons darker than the order line's. */
.order-catalog-drawer .cat-act-btn {
    width: 2.125rem;
    height: 2.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sn-rail);
    border-radius: 0.5rem;
    background: var(--bg-surface);
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.order-catalog-drawer .cat-act-btn i {
    font-size: 1rem;
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
}

.order-catalog-drawer .cat-row:hover .cat-act-btn,
.order-catalog-drawer .cat-act-btn:focus-visible {
    opacity: 1;
}

/* The blue hover now lives in the "Row actions on AbenaV3Button" block below, which has to reach
   the Neutral theme's own :hover specificity — a rule at this level would lose to it. */

.order-catalog-drawer .cat-act-btn--empty {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

.order-catalog-drawer .cat-act-btn.is-fav {
    opacity: 1;
    border-color: transparent;
    color: #F0A400;
}

.order-catalog-drawer .cat-act-btn.is-fav:hover {
    border-color: #F0A400;
    background: rgba(240, 164, 0, 0.08);
}

/* `!important` on the family, and it is not optional: the drawer-wide
   `.order-catalog-drawer input { font-family: inherit !important }` above (itself there to beat
   Abena-main.css) outranks this rule without it, however specific it is. The input then inherits
   Gilroy-Regular and the 700 below renders as a SYNTHESISED bold rather than the real Gilroy-Bold
   face — exactly the failure that rule's own comment warns about for the footer CTA. */
.order-catalog-drawer .cat-row.is-added .abena-v3-qty input {
    color: var(--abena-color-action-blue);
    font-family: var(--font-body-bold) !important;
    font-weight: 700;
    border-color: var(--abena-color-action-blue);
}

/* ---------- Footer recap ----------
   The design's `.drawer-recap` now lives once, in Abena-v3.css, as the `--stacked` shape of
   `.abena-v3-info-box`.

   Only the bold face stays here: both order drawers run on Gilroy, which ships one family per
   weight, so `font-weight: 700` alone would synthesise a fake bold instead of using Gilroy-Bold. */
:is(.order-catalog-drawer, .new-order-panel) .abena-v3-info-box__value,
.new-order-panel .abena-v3-slide-panel__footer .abena-v3-btn {
    font-family: var(--font-body-bold);
}

/* Design `.drawer-footer .btn`: full width, 44px, bold. */
.order-catalog-drawer .cat-recap-cta {
    height: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
    padding: 0 1rem; /* 16px — design .btn */
    gap: 0.375rem; /* 6px — design .btn */
    border-radius: 0.75rem;
    font-family: var(--font-body-bold);
    font-weight: 700;
}

/* ============================================================================
   Article details drawer
   Only this panel's own layout lives here: the drawer chrome (backdrop, header,
   close, animation, secondary stacking) comes from `.abena-v3-slide-panel` in
   Abena-v3.css. Every rule is scoped under `.article-details-drawer` so nothing
   here can reach the other SlidePanel consumers.
   ============================================================================ */

/* TYPOGRAPHY — `.abena-v3-slide-panel` puts every drawer in --abena-v3-font (Roboto); the
   prototype's computed styles are Gilroy 14px/500. Set here on the panel root.

   `Gilroy` at weight 400 renders SemiBold in this app: Abena-fonts.css declares the SemiBold
   face with `font-weight: 600 !important`, and !important is invalid in an @font-face
   descriptor — the declaration is dropped, the descriptor falls back to `normal` (400), and
   that face then shadows Gilroy-Regular. The named single-weight family is the only way to
   reach Regular; the multi-weight family is kept for the bold runs, whose 700 face is fine. */
.abena-v3-slide-panel.article-details-drawer {
    /* 560px per the prototype, against the shared shell's 31.5625rem (505px). Scoped to this
       drawer through the `Class` parameter — the same mechanism `--wide` uses for the catalogue
       — so the other seven SlidePanel consumers keep the default width. px, not rem: the app
       scales the root font-size at width breakpoints and a rem value would drift. */
    width: 560px;
    max-width: calc(100vw - 2rem);

    --font-body: 'Gilroy', sans-serif;
    --font-body-regular: 'Gilroy-Regular', 'Gilroy', sans-serif;

    font-family: var(--font-body-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* The shared body stacks its children 32px apart, a value the room-panel design gave it
   (`.rp-form`). This drawer follows the order mock, whose `.drawer-body` uses 24px — the gap that
   sets the rhythm between Hiérarchie, Conditionnement, Pictogramme, Visuels and Documents. Scoped
   here rather than changed on the shared class, which the Chambres / Résidents panels also use. */
.article-details-drawer .abena-v3-slide-panel__body {
    gap: 1.5rem; /* 24px — per design .drawer-body */
}

.article-details-drawer .ad-row-value,
.article-details-drawer .ad-document-name,
.article-details-drawer .ad-section-title {
    font-family: var(--font-body);
}

/* This app has no global `* { box-sizing: border-box }`; padded cards below rely on it. */
.article-details-drawer .ad-card,
.article-details-drawer .ad-visual,
.article-details-drawer .ad-document {
    box-sizing: border-box;
}

.article-details-drawer .ad-section {
    display: flex;
    flex-direction: column;
    gap: 0.625rem; /* 10px — per design, `.summary-label`'s margin-bottom */
}

/* Design `.summary-label`, NOT the pictogram label sitting a few rules below — the two look alike
   but the mock gives this one 600 / .06em, and it was copied from the wrong one. */
.article-details-drawer .ad-section-title {
    margin: 0;
    font-size: 0.75rem; /* 12px — design --font-size-xs */
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sn-text-muted);
}

.article-details-drawer .ad-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem; /* 10px — per design .fiche-box */
    background: var(--sn-surface-subtle);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
}

/* The identity card is the only one that needs no section title above it. */
.article-details-drawer .ad-identity {
    gap: 0.625rem;
}

.article-details-drawer .ad-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem; /* 12px — per design .fiche-row */
    font-size: 0.875rem; /* 14px — design --font-size-md */
    line-height: 1.5; /* inherited by the design's .fiche-row from its body */
}

.article-details-drawer .ad-row-label {
    color: var(--sn-text-muted);
    flex-shrink: 0;
}

.article-details-drawer .ad-row-value {
    font-weight: 700;
    color: var(--sn-text);
    text-align: right;
}

.article-details-drawer /* ---------- Pictogram (design `.fiche-pictogram`) ----------
   Washables only, and derived rather than stored — see the comment in the razor. The green pair is
   the one OrderLineSectionGrouper already defines for the washables band (#0E8C7A on #E3F5F2), so
   the card and the band cannot drift apart. */
.ad-picto {
    width: 6.875rem; /* 110px */
    border: 0.0625rem solid var(--sn-rail);
    border-radius: 0.5rem;
    overflow: hidden;
}

.ad-picto-label {
    display: block;
    padding: 0.375rem 0.25rem;
    background: var(--bg-surface);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    color: var(--abena-color-page-title);
}

.ad-picto-swatch {
    position: relative; /* the image is layered over the fallback glyph */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 5rem; /* 80px */
    background: var(--color-teal-bg);
    color: var(--color-teal);
    overflow: hidden;
}

/* Covers the glyph once loaded; `onerror` hides it again and the glyph shows through. */
.ad-picto-swatch img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    box-sizing: border-box;
    background: var(--color-teal-bg);
}

.ad-picto-swatch i {
    font-size: 2.125rem; /* 34px */
    line-height: 1; /* the app's global `i { line-height: 1.5rem }` would offset the glyph */
}

/* ---------- Eco-labels (design `.fiche-eco`) ---------- */
.ad-eco {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ad-eco-chip {
    display: inline-flex;
    align-items: center;
    height: 2.125rem; /* 34px */
    padding: 0 1rem;
    border: 0.0625rem solid var(--sn-rail);
    border-radius: 999rem;
    font-size: 0.875rem;
    color: var(--abena-color-page-title);
}

/* Hierarchy and classification sit side by side, and stack on a narrow drawer. */
.article-details-drawer .ad-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem; /* 16px — per design .fiche-box-cols */
}

/* ---------- Visuals ---------- */

.article-details-drawer .ad-visuals {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.article-details-drawer .ad-visual {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--sn-surface-subtle);
    border: 1px solid var(--sn-rail);
    border-radius: 0.5rem;
}

/* What shows through when the image cannot load. The tile is ~115px wide inside a 560px
   drawer, and the stored names are GUIDs, so the name breaks anywhere and is clamped rather
   than overflowing the tile. */
.article-details-drawer .ad-visual-fallback {
    /* Absolute like the `img` it sits under. In flow it was a flex item of the tile, so a wrapping
       GUID pushed the tile past its `aspect-ratio: 1` square and made the whole Visuels row taller
       than the design's — visible on any machine where the visuals folder is absent, which is every
       dev machine, since it is not in git. */
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem;
    text-align: center;
    color: #98A0AE;
}

.article-details-drawer .ad-visual-fallback i {
    font-size: 1.25rem;
    color: #C8CDD6;
}

.article-details-drawer .ad-visual-name {
    font-size: 0.5625rem;
    line-height: 1.3;
    word-break: break-all;
    overflow: hidden;
}

/* Fills the tile and carries the tile's own background, so a loaded image hides the glyph
   underneath it including the letterboxed edges left by object-fit: contain. */
.article-details-drawer .ad-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--sn-surface-subtle);
}

/* ---------- Documents ---------- */

.article-details-drawer .ad-documents {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Prototype's computed `.rc-doc`: padding 9px 12px, gap 12px, 1px #DFE3E8, radius 8px,
   Gilroy 14px/500 — which lands the row at 56px tall. Ours was 12px/16px padding and 66px.
   px, not rem: the app scales the root font-size at width breakpoints. */
.article-details-drawer .ad-document {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--sn-rail);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    transition: background 0.12s, border-color 0.12s;
}

/* Prototype `.doc-entry:hover` — `--tint-primary-soft` rgba(0,68,194,.06) over
   `--color-gray-400` #E0E0E0. No `cursor: pointer` with it, unlike the prototype: there the whole
   row is clickable (its button calls `event.stopPropagation()`), here only the download link is,
   and a pointer over dead space would promise a click that does nothing. */
.article-details-drawer .ad-document:hover {
    background: rgba(0, 68, 194, 0.06);
    border-color: #E0E0E0;
}

.article-details-drawer .ad-document-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: rgba(187, 72, 65, 0.1);
    color: var(--abena-color-error);
}

.article-details-drawer .ad-document-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.article-details-drawer .ad-document-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--sn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-details-drawer .ad-document-kind {
    font-size: 0.75rem;
    color: var(--sn-text-muted);
}

/* The skin is AbenaV3Button's now (Info + Outline + Small = the prototype's
   `btn btn-outline btn-sm`), so the only thing left to state is that the button must not be
   squeezed by the document name next to it on the row's flex line. */
.article-details-drawer .ad-document-link {
    flex-shrink: 0;
}

/* ---------- Footer ---------- */

.article-details-drawer .ad-footer {
    display: flex;
    justify-content: flex-end;
}

/* ============================================================
   Order history slide panel (SlidePanel body).

   Rules lifted from the prototype rather than re-approximated: .hist-* geometry, the
   badge-ico square and the connector line are the prototype's own values.

   This is NOT a scoped .razor.css. SlidePanel teleports its body through <SectionContent>
   into the SlidePanelHost outlet on AbsMainLayout, so component-scoped CSS would not reach
   it. Same reason AssignRoomSlidePanel's .assign-panel__* rules live in Abena-resident.css.

   Design tokens are scoped to .order-history-panel rather than :root, mirroring
   .progression-plan-wizard-page in Abena-progression-plan.css — the panel resolves its
   var(--*) without leaking tokens to the rest of the app.
   ============================================================ */

.order-history-panel {
    --ohp-primary-600: #0044C2;
    --ohp-tint-primary: rgba(0, 68, 194, 0.10);
    --ohp-fg-primary: #0D1740;
    --ohp-fg-secondary: #565D79;
    --ohp-border-divider: #DFE3E8;
    --ohp-radius-sm: 6px;
    --ohp-font-display: 'Rounded Mplus 1c Bold', sans-serif;
    --ohp-font-size-xs: 12px;
    --ohp-font-size-sm: 13px;
    --ohp-font-size-md: 14px;
}

/* The prototype's stylesheet relies on a global `* { box-sizing: border-box }`; scope it
   here so paddings do not inflate the timeline rows. */
.order-history-panel,
.order-history-panel * {
    box-sizing: border-box;
}

.hist-timeline {
    display: flex;
    flex-direction: column;
}

.hist-day {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 12px;
    font-family: var(--ohp-font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ohp-fg-secondary);
}

.hist-day:not(:first-child) {
    margin-top: 12px;
}

.hist-day::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ohp-border-divider);
}

.hist-item {
    display: flex;
    gap: 14px;
}

.hist-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* Connector between consecutive entries; the last entry has no tail. */
.hist-item:not(:last-child) .hist-line::after {
    content: "";
    flex: 1;
    width: 2px;
    background: var(--ohp-border-divider);
    margin: 4px 0;
}

.hist-item .badge-ico {
    flex-shrink: 0;
}

.order-history-panel .badge-ico {
    width: 28px;
    height: 28px;
    border-radius: var(--ohp-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* The app's global `i { line-height: 1.5rem }` inflates the icon line-box and makes each
   row taller than the prototype — pin it. */
.order-history-panel .badge-ico i {
    font-size: 16px;
    line-height: normal;
}

.order-history-panel .bi-primary {
    background: var(--ohp-tint-primary);
}

.order-history-panel .bi-primary i {
    color: var(--ohp-primary-600);
}

.hist-body {
    padding-bottom: 20px;
    flex: 1;
    min-width: 0;
}

.hist-item:last-child .hist-body {
    padding-bottom: 0;
}

.hist-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hist-act {
    font-size: var(--ohp-font-size-md);
    font-weight: 700;
    color: var(--ohp-fg-primary);
}

.hist-date {
    font-size: var(--ohp-font-size-xs);
    color: var(--ohp-fg-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hist-detail {
    font-size: var(--ohp-font-size-sm);
    color: var(--ohp-fg-secondary);
    margin-top: 2px;
}

.hist-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--ohp-font-size-xs);
    color: var(--ohp-fg-secondary);
    margin-top: 6px;
}

.hist-body > .hist-user {
    margin-top: 5px;
}

.hist-av {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ohp-primary-600);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-history-panel__empty {
    font-size: var(--ohp-font-size-sm);
    color: var(--ohp-fg-secondary);
    padding: 8px 0;
}

.order-history-panel__loading {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* ============================================================================
   Grouped order lines (OrderLinesGroupedGrid / OrderLineRow)
   Ported from the design's `.cmd-group` blocks: one card per group, each with its own column
   header row, a coloured dot and a matching left border. Values read off the live prototype.
   Scoped under `.ord-groups` so nothing here reaches the Telerik grid this sits beside.
   ============================================================================ */

.ord-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ord-groups *,
.ord-groups *::before,
.ord-groups *::after {
    box-sizing: border-box;
}

.ord-groups {
    font-family: var(--font-body-regular);
    font-size: 0.875rem;
}

.ord-groups__empty,
.ord-groups__loading {
    padding: 2rem;
    text-align: center;
    color: var(--sn-text-muted);
}

/* ---------- Empty order ---------- */

.ord-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 24px;
    background: var(--bg-surface);
    border: 1px solid rgba(0, 61, 125, 0.173);
    border-radius: 12px;
    box-shadow: 0 2px 10px 0 var(--abena-shadow-card-glow);
    text-align: center;
}

.ord-empty__icon {
    font-size: 40px;
    line-height: 40px;
    color: #C9CCD1;
}

.ord-empty__title {
    margin: 0;
    font-family: "Rounded Mplus 1c Bold", var(--kendo-font-family);
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    color: var(--abena-color-page-title);
}

.ord-empty__desc {
    max-width: 280px;
    margin: 0;
    font-size: 14px;
    line-height: 21px;
    color: var(--sn-text-muted);
}

.ord-empty .ord-empty__cta {
    margin-top: 8px;
    padding: 0 16px;
}

/* ---------- Band ---------- */

/* Design `.cmd-tier`: the order is split first by what kind of product a line is, and only the
   allocation band is broken down further by category. The heading colours are the band's; the
   cards under it carry their own. */
.ord-tier {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* 12px */
}

/* 12px from the flex gap plus 14px here — the design separates two bands more than it separates
   two cards inside one. */
.ord-tier + .ord-tier {
    margin-top: 0.875rem; /* 14px */
}

.ord-tier__head {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* 10px */
    margin: 0 0 0.125rem 0.125rem; /* 2px below, 2px in from the card edge */
}

.ord-tier__dot {
    width: 0.625rem; /* 10px — larger than a group's 8px dot */
    height: 0.625rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--sn-rail);
}

.ord-tier__title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-primary-900);
}

.ord-tier__desc {
    font-size: 0.875rem;
    color: var(--sn-text-muted);
}

/* ---------- Group card ---------- */

/* The left border is the group's accent; the inline style supplies the colour and this is the
   fallback for a group that has none (the uncategorized block). */
.ord-group {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 61, 125, 0.173);
    border-left: 3px solid var(--sn-rail);
    border-radius: 0.75rem; /* 12px on all four corners — the accent border is rounded too */
    box-shadow: 0 2px 10px 0 var(--abena-shadow-card-glow);
    overflow: hidden;
}

.ord-group__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem; /* 10px */
    padding: 0.875rem 1.25rem; /* 14px 20px */
    cursor: pointer;
    user-select: none;
}

.ord-group__caret {
    font-size: 1rem;
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
    color: var(--sn-text-muted);
    transition: transform 120ms ease;
}

.ord-group.is-collapsed .ord-group__caret {
    transform: rotate(-90deg);
}

.ord-group.is-collapsed .ord-group__scroll {
    display: none;
}

.ord-group__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--sn-rail);
}

.ord-group__title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    color: var(--abena-color-page-title);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ord-group__count {
    font-size: 0.8125rem; /* 13px */
    color: var(--sn-text-muted);
    flex-shrink: 0;
}

/* ---------- Flat card ("Par n° de réf.") ---------- */

/* Same surface as a group card without the category accent: the design uses its generic `.card`
   for this layout, so the radius runs on all four corners. */
.ord-flat {
    background: var(--bg-surface);
    border: 1px solid rgba(0, 61, 125, 0.173);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Narrow viewports scroll the row grid rather than crushing the columns. */
.ord-group__scroll,
.ord-flat__scroll {
    overflow-x: auto;
}

/* ---------- Rows ---------- */

/* Shared by the header row and the data rows so the two cannot drift apart. */
.ord-row {
    display: grid;
    font-family: var(--font-body);
    font-weight: 400;
    grid-template-columns: 84px minmax(150px, 1.6fr) minmax(156px, 1fr) var(--ord-price-col) 122px 84px 172px;
    align-items: center;
    column-gap: 10px;
    padding: 11px 12px;
    /* Wide enough for the tracks themselves, so a narrow viewport scrolls instead of crushing the
       columns. `min-content` and not a literal: a hand-written 60rem was already narrower than the
       tracks add up to, so the row BOX stopped short of the scroll width while its cells carried on
       past it — at the right-hand end of the scroll the separators and the hover wash were cut off
       and the actions column sat flush against the edge with none of the 14px inset. Any future
       change to a track width keeps this honest on its own. */
    min-width: min-content;
}

/* Prix HT track: wide enough for the "Prix indisponible" pill on one line, which is longer in German and Dutch. */
.ord-groups {
    --ord-price-col: 116px;
}

html[lang="de"] .ord-groups,
html[lang="nl"] .ord-groups {
    --ord-price-col: 138px;
}

/* Establishment without prices: no unit price and total tracks. */
.ord-groups--no-prices .ord-row {
    grid-template-columns: 84px minmax(150px, 1.6fr) minmax(156px, 1fr) 122px 172px;
}

/* The design puts the separator under the group header on this row's top edge, not on the header
   itself, so a collapsed group shows no dangling rule. */
.ord-row--head {
    padding: 0 12px;
    min-height: 2.625rem; /* 42px */
    border-top: 1px solid var(--sn-rail); /* #DFE3E8 — design --border-divider */
    color: var(--color-label);
    font-size: 0.875rem;
}

/* Every row, not just siblings: the design's first row carries a top border too, and that is
   what draws the rule under the column header (the header itself has no bottom border, so a
   collapsed group shows none). */
.ord-rows .ord-row {
    min-height: 66px; /* design `.cmd-row` */
    border-top: 1px solid var(--sn-rail); /* #DFE3E8 — design --border-divider */
    transition: background 0.15s; /* design `.cmd-row` */
}

/* Design `.cmd-row:hover`. Data rows only: the design hovers `.cmd-row`, and its column header is
   a separate `.cmd-row-head` — hence the `.ord-rows` scope, which excludes `.ord-row--head`. */
.ord-rows .ord-row:hover {
    background: var(--bg-page); /* design --color-gray-50 */
}

.ord-row.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.ord-cell--num {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.0625rem;
}

.ord-cell--actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* The design left-aligns the Actions header while the buttons stay right-aligned. */
.ord-row--head .ord-cell--actions {
    justify-content: flex-start;
}

.ord-cell--price {
    padding-right: 4px;
}

/* Total HT is left-aligned in the design, not right like Prix HT. */
.ord-cell--total {
    text-align: left;
}

/* The design centres this column — header and stepper both. Declared after `.ord-cell--num` so a
   cell carrying both still centres. */
.ord-cell--qty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ord-cell--ref {
    color: var(--sn-text-muted);
}

.ord-cell--desig {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

/* Design `.cmd-desig-link`: the favourite star sits inline before the name, and only the name
   ellipsises — hence the row rather than letting the icon share the truncated span. */
.ord-desig-line {
    display: flex;
    align-items: baseline; /* not center: the name wraps, and the star belongs on its first line */
    gap: 0.3125rem; /* 5px */
    min-width: 0;
}

.ord-desig-fav {
    font-size: 0.8125rem; /* 13px */
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
    color: #F0A400;
    flex-shrink: 0;
}

.ord-desig {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--abena-color-page-title);
    /* Wraps rather than truncating: the app's article names are longer than the design's and
       the ellipsis hid the part that distinguishes two variants of the same product. */
    min-width: 0;
    overflow-wrap: anywhere;
}

.ord-desig-sub {
    font-size: 12px;
    color: var(--sn-text-muted);
    overflow-wrap: anywhere;
}

/* The design wraps this cell rather than truncating it — the app's unit names ("Carton(s) de 112
   Pièce(s) · 4 Sachet(s) × 28 Pièce(s)") are longer than the design's, and the quantities are the
   part that matters, so clipping them would defeat the column. Capped at two lines to keep rows
   from growing without bound. */
.ord-cell--cond {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    font-size: 14px;
    color: var(--sn-text-muted);
    line-height: 1.35;
}

.ord-cell--cond .ord-cond-main,
.ord-cell--cond .ord-cond-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ord-cell--cond .ord-cond-sub::before {
    content: "·\00A0";
}

.ord-desig-sub {
    display: inline-flex;
    align-items: baseline; /* as `.ord-desig-line`: the icon stays on the first wrapped line */
    gap: 4px;
}

.ord-desig-sub i {
    font-size: 11px;
    line-height: normal;
}

/* Last-order quantity and unit, kept together and emphasised. */
.ord-desig-sub .ord-last-qty {
    font-family: var(--font-body-semibold);
    color: var(--abena-color-page-title);
    white-space: nowrap;
}

/* Design `.cmd-ded-badge`: what the line already had deducted from stock, drawn with
   AbenaV3StatusBadge (`.res-badge`) in its blue tone, whose tint and colour match the prototype's
   `--tint-primary` / `--color-primary-600` exactly. Only the geometry the shared primitive does
   not already carry is restated: the cell is a flex column, so the pill must not stretch across
   it, and the prototype's padding/gap are a pixel off the primitive's.

   Scoped to the designation cell so the badge keeps rendering as-is everywhere else it is used
   (the sidebar pills, the orders list, the German patients grid). */
.ord-cell--desig .res-badge {
    align-self: flex-start;
    margin-top: 0.125rem; /* 2px, as the prototype's badge */
    padding: 0 0.6875rem; /* 11px */
    gap: 0.3125rem;       /* 5px */
    margin-bottom: 0.25rem;
}

/* The badge carries an icon instead of the dot; the app's global `i { line-height: 1.5rem }`
   would otherwise inflate the 24px pill — same pin as the sidebar's pills. */
.ord-cell--desig .res-badge i {
    font-size: 0.75rem; /* 12px */
    line-height: 1;
    flex-shrink: 0;
}

.ord-cell--desig .res-badge.ord-stock-tag {
    height: auto;
    min-height: 1.5rem;
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
    border-radius: 0.75rem;
    white-space: normal;
}

/* Shown in place of the price while the SAP recalculation triggered by a quantity change runs.
   `line-height: normal` for the same reason as `.ord-desig-fav` above. */
.ord-price-sync {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: -18px;
    font-size: 14px;
    color: var(--sn-text-muted);
    white-space: nowrap;
}

.ord-price-sync i {
    font-size: 0.8125rem; /* 13px */
    line-height: normal;
    animation: ord-spin 1s linear infinite;
}

@keyframes ord-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Design `.cmd-price-pill` — the line's tariff was not returned. Sits in the price cell, which
   already right-aligns its children against the 18px inset, so it needs no alignment of its own.
   Wraps to two lines and runs into the 18px inset: the column is narrower than the label. */
.ord-price-pill {
    display: inline-flex;
    white-space: nowrap;
    margin-right: -18px;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 3px 10px;
    border-radius: 11px;
    background: rgba(187, 72, 65, 0.12);
    color: var(--color-error);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.ord-price-pill i {
    font-size: 12px;
    flex-shrink: 0;
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
}

/* Values only. Scoped to `.ord-rows` because the header row reuses `.ord-cell--total` for its
   own label, and in the design only the Prix HT header is semibold — Total HT's is regular. */
.ord-price,
.ord-rows .ord-cell--total {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--abena-color-page-title);
    white-space: nowrap;
}

/* Design `.cmd-pts-cost` — a PLV line's cost in points, standing in for the euro price and, on
   the total column, for the euro total. Same treatment as the catalogue drawer's `.cat-pts-cost`
   so an article reads the same in both places. */
.ord-pts-cost {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem; /* 4px */
    font-family: "Rounded Mplus 1c Bold", "Rounded Mplus 1c", Gilroy-Bold, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-violet);
    white-space: nowrap;
}

.ord-pts-cost i {
    font-size: 0.8125rem; /* 13px — the design sets this inline on the price cell's icon */
    line-height: normal; /* the app's global `i { line-height: 1.5rem }` inflates the line box */
}

.ord-pts-u {
    font-size: 0.75rem; /* 12px — design `.cmd-pts-cost .u` */
    font-family: var(--font-body);
    font-weight: 600;
}

/* Design `.cmd-pts-rate` — same badge the catalogue drawer uses, kept identical on purpose. */
.ord-pts-rate {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.1875rem;
    padding: 0.1875rem 0.625rem;
    border-radius: 999rem;
    font-size: 0.6875rem;
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--color-violet);
    background: rgba(143, 73, 212, 0.1);
    white-space: nowrap;
}

.ord-pts-rate i {
    font-size: 0.6875rem;
    line-height: normal;
}

/* ---------- Quantity (read-only) ---------- */

.ord-qty-static {
    font-family: var(--font-body);
    font-weight: 600;
}

/* ---------- Row actions ---------- */

.ord-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.125rem;
    max-height: none;
    padding: 0 0.75rem;
    border: 1px solid var(--sn-rail);
    border-radius: 0.5rem;
    background: var(--bg-surface);
    color: var(--sn-text);
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: normal;
    cursor: pointer;
    white-space: nowrap;
}

.ord-act-btn i {
    font-size: 1rem;
    line-height: normal;
}

.ord-act-btn--icon {
    width: 2.125rem;
    padding: 0;
}

.ord-act-btn--icon i {
    line-height: 0 !important;
}

/* Design's "Déduire": a blue outline button, unlike the neutral icon buttons beside it. */
.ord-act-btn--deduct {
    padding: 0 0.625rem; /* 10px */
    gap: 0.3125rem; /* 5px */
    font-size: 0.75rem; /* 12px */
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--abena-color-action-blue);
    border-color: var(--abena-color-action-blue);
}

.ord-act-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Row actions on AbenaV3Button ---------- */

/* These buttons are AbenaV3Button with Theme=Neutral, FillMode=Outline. That theme
   (Abena-v3.css) already resolves to the design's own tokens — `--sn-rail` #DFE3E8 is the
   design's `--color-gray-300` border, `--sn-text-muted` #565D79 its `--color-gray-500` icon
   colour — so the resting look comes from the component rather than being restated here.

   Two things the theme does NOT match, pinned below. Both selectors add `.abena-v3-btn` to
   reach the theme's two-class specificity; this file loads after Abena-v3.css, so a tie
   resolves here.
     - min-height: the theme's 2.3125rem against the design's 34px row-action square.
     - :hover: the theme fades toward grey, the design tints toward the action blue
       (`.cmd-fa:hover`) and red for delete (`.cmd-rm:hover`). */
.abena-v3-btn.ord-act-btn,
.order-catalog-drawer .abena-v3-btn.cat-act-btn {
    min-height: 2.125rem;
}

/* Design `.cmd-fa` / `.cmd-rm`: a 34px square with the light divider border and muted icon. */
.abena-v3-btn.ord-act-btn--icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--sn-rail);
    color: var(--sn-text-muted);
}

/* `:not(.is-fav)` is not cosmetic: this selector outranks `.cat-act-btn.is-fav:hover`, so without
   the exclusion a favourite's gold hover would be repainted blue. Excluding it here is steadier
   than escalating the gold rule, which would have to stay ahead of this one forever. */
.abena-v3-btn.ord-act-btn:hover:not(:disabled),
.order-catalog-drawer .abena-v3-btn.cat-act-btn:hover:not(:disabled):not(.is-fav) {
    border-color: var(--abena-color-action-blue);
    color: var(--abena-color-action-blue);
    background: rgba(0, 68, 194, 0.05);
}

/* Déduire is the Info theme, whose `--outline:hover…--info` rule would otherwise replace the
   design's tint with Kendo's info-subtle. Same specificity as the rule above, so it must follow it. */
.abena-v3-btn.ord-act-btn--deduct:hover:not(:disabled) {
    background: rgba(0, 68, 194, 0.08);
    color: var(--abena-color-action-blue);
    border-color: var(--abena-color-action-blue);
}

/* Must follow the rule above: same specificity, so source order decides. Design `.cmd-rm:hover`
   uses --color-error #BB4841 over --tint-error; this app's --abena-color-error is that colour. */
.abena-v3-btn.ord-act-btn--danger:hover:not(:disabled) {
    border-color: var(--abena-color-error);
    color: var(--abena-color-error);
    background: rgba(187, 72, 65, 0.12);
}

/* ============================================================================
   Stock deduction modal.

   An AbsModalWindow. Chrome follows `.abena-v3-modal--order-recap` above, built from the SAME
   prototype card, so the two dialogs stay consistent: 18px/20px head, 1px divider, title +
   subtitle stack.

   Prototype tokens map onto the app's: --fg-primary #0D1740 = --abena-color-page-title,
   --fg-secondary #565D79 = --sn-text-muted, --color-primary-600 #0044C2 =
   --abena-color-action-blue, --color-gray-100 #F2F4F6, --border-default rgba(0,61,125,.173).

   NOTE the two computed blocks (.ded-theo and .ded-after-box) are styled here but fed
   PLACEHOLDER values by the component — their calculation is handled separately.
   ============================================================================ */

.k-window.abena-v3-modal--deduction {
    /* 520px — the prototype sets it inline on #rc-card (`style="width: 520px"`), overriding
       .rc-card's own 560px. px, not rem: the app rescales the root font at width breakpoints. */
    width: 520px !important;
    max-width: calc(100vw - 2rem) !important;

    /* Same Gilroy mapping as the order edit page and the recap modal: the prototype's Gilroy
       has no Medium face, so its declared 500 renders Regular — reproduced as 400 here. */
    --font-body: 'Gilroy', sans-serif;
    --font-body-regular: 'Gilroy-Regular', 'Gilroy', sans-serif;

    font-family: var(--font-body-regular);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    border-radius: 14px;
    overflow: hidden;
}

/* ---------- Head (.rc-head) ---------- */
.k-window.abena-v3-modal--deduction .k-window-titlebar,
.k-window.abena-v3-modal--deduction-info .k-window-titlebar {
    height: auto;
    min-height: 0;
    padding: 18px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--sn-rail);
    display: flex;
    align-items: center;
    gap: 12px;
}

.k-window.abena-v3-modal--deduction .k-window-titlebar .k-window-title,
.k-window.abena-v3-modal--deduction-info .k-window-titlebar .k-window-title {
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}

.k-window.abena-v3-modal--deduction .k-window-titlebar-actions,
.k-window.abena-v3-modal--deduction-info .k-window-titlebar-actions {
    margin: 0;
    flex-shrink: 0;
}

.abena-v3-modal--deduction .abs-window-header,
.abena-v3-modal--deduction-info .abs-window-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
}

/* `.badge-ico.bi-primary` — the 28px tinted box holding `uil-box`. Rendered through ::before
   because AbsModalWindow builds the header in C# and puts TitleAddon INSIDE the text column,
   after the title. Same technique as .abena-v3-modal--price-changes, which needs a leading
   chip for the same reason; the codepoint is unicons' uil-box. */
.abena-v3-modal--deduction .abs-window-header::before,
.abena-v3-modal--deduction-info .abs-window-header::before {
    content: '\e9b6';
    font-family: 'unicons-line';
    font-style: normal;
    font-weight: normal;
    font-size: 16px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--abena-color-action-blue);
    background: var(--abena-color-badge-blue-bg);
}

.abena-v3-modal--deduction .abs-window-text,
.abena-v3-modal--deduction-info .abs-window-text {
    /* Without display:flex the subtitle stays inline and runs on after the title — the base
       class does not set it; --order-recap and --price-changes declare it for the same reason. */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    min-width: 0;
    font-family: "Rounded Mplus 1c Bold", var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--abena-color-page-title);
}

.abena-v3-modal--deduction .abs-window-subtitle,
.abena-v3-modal--deduction-info .abs-window-subtitle {
    margin-top: 2px;
    font-family: var(--font-body-regular);
    font-size: 13px;
    font-weight: 400;
    color: var(--sn-text-muted);
}

/* ---------- Body (.rc-body) ---------- */
.abena-v3-modal--deduction .inner-content,
.abena-v3-modal--deduction-info .inner-content {
    padding: 18px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.abena-v3-modal--deduction .order-deduction {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* This app has no global `* { box-sizing: border-box }`; the padded blocks below rely on it. */
.abena-v3-modal--deduction .order-deduction *,
.abena-v3-modal--deduction .order-deduction *::before,
.abena-v3-modal--deduction .order-deduction *::after {
    box-sizing: border-box;
}

.abena-v3-modal--deduction .order-deduction__error {
    font-size: 14px;
    color: var(--abena-color-error);
}

/* ---------- Theoretical stock (.ded-theo) — PLACEHOLDER VALUES ---------- */
.abena-v3-modal--deduction .ded-theo {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid rgba(0, 68, 194, .20);
    border-radius: 8px;
    background: var(--abena-color-badge-blue-bg);
}

.abena-v3-modal--deduction .ded-theo > i {
    font-size: 16px;
    line-height: 1;
    color: var(--abena-color-action-blue);
    flex-shrink: 0;
    margin-top: 1px;
}

.abena-v3-modal--deduction .dt-main {
    font-size: 14px;
    color: var(--abena-color-page-title);
}

.abena-v3-modal--deduction .dt-main b {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--abena-color-action-blue);
}

.abena-v3-modal--deduction .dt-sub {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sn-text-muted);
}

/* ---------- Pack steppers (.ded-packs) — the real, existing behaviour ---------- */
.abena-v3-modal--deduction .ded-packs {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.abena-v3-modal--deduction .ded-pack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.abena-v3-modal--deduction .ded-pack-lbl {
    font-size: 13px;
    color: var(--sn-text-muted);
}

/* ---------- After-deduction summary (.ded-after-box) — PLACEHOLDER VALUES ---------- */
.abena-v3-modal--deduction .ded-after-box {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--sn-row-selected);
}

.abena-v3-modal--deduction .ded-after {
    font-size: 14px;
    color: var(--sn-text-muted);
}

.abena-v3-modal--deduction .ded-after b {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--abena-color-page-title);
}

/* The prototype writes this one inline: `style="color:var(--color-primary-900)"` (#002C75). */
.abena-v3-modal--deduction .ded-after b.ded-after-target {
    color: var(--abena-color-title-deep);
}

/* ---------- Foot (.rc-foot) ---------- */
.abena-v3-modal--deduction .bottom-bar,
.abena-v3-modal--deduction-info .bottom-bar {
    padding: 14px 20px;
    border-top: 1px solid var(--sn-rail);
    background: var(--sn-surface-subtle);
}

/* The prototype right-aligns its two buttons; the shared footer centres and stretches them. */
.abena-v3-modal--deduction .abena-v3-modal__footer,
.abena-v3-modal--deduction-info .abena-v3-modal__footer {
    justify-content: flex-end;
    gap: 8px;
}

.abena-v3-modal--deduction .abena-v3-modal__footer .abena-v3-modal__action,
.abena-v3-modal--deduction-info .abena-v3-modal__footer .abena-v3-modal__action {
    flex: 0 0 auto;
}


/* ============================================================================
   Stock deduction INFO popup.

   The designers' catch-up mockup, which never shipped as prototype HTML: the only reference is
   a screenshot. Every figure below was MEASURED off it (the capture is 1:1 — its 28px header
   chip measures 28px), not inferred, and the ones that resolved to a token the app already owns
   are written as that token:

     measured #11183E → var(--abena-color-page-title)  (#0D1740, 19 uses in Abena-v3.css)
     measured #585E77 → var(--sn-text-muted)           (#565D79, same)
     measured #2548BB → var(--abena-color-action-blue) (#0044C2, the "Modifier" outline)

   Four had no token and are declared once, at the top, so a designer can retune them in one
   place: the violet the deducted figures and the header chip are drawn in, its tint, the summary
   panel's grey, and the navy of the resulting quantity.

   All the chrome — titlebar, header chip geometry, subtitle, body padding, footer — is SHARED
   with .abena-v3-modal--deduction above rather than copied: the two dialogs open one another and
   must not drift. Only the width, the chip's two colours and the body below are its own.
   ============================================================================ */

.k-window.abena-v3-modal--deduction-info {
    /* 480px — the mockup card measures 478px edge to edge at 1:1. Narrower than its sibling's
       520px on purpose: this one carries four rows, not a stepper per packaging.
       px, not rem: the app rescales the root font at width breakpoints. */
    width: 480px !important;
    max-width: calc(100vw - 2rem) !important;

    /* Same Gilroy mapping as the deduct modal: the prototype's Gilroy has no Medium face, so its
       declared 500 renders Regular — reproduced as 400 here. */
    --font-body: 'Gilroy', sans-serif;
    --font-body-regular: 'Gilroy-Regular', 'Gilroy', sans-serif;

    /* Measured off the mockup; no app token carries them yet. */
    --odi-accent: #8254CD;
    --odi-accent-tint: #F1ECFE;
    --odi-panel: #F1F2F7;
    --odi-total: #152E71;

    font-family: var(--font-body-regular);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    border-radius: 14px;
    overflow: hidden;
}

/* The chip's geometry comes from the shared rule; only its colours differ — the mockup draws
   this one in the violet it uses for everything the deduction touched. */
.abena-v3-modal--deduction-info .abs-window-header::before {
    color: var(--odi-accent);
    background: var(--odi-accent-tint);
}

/* ---------- Body ---------- */
.abena-v3-modal--deduction-info .order-deduction-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* This app has no global `* { box-sizing: border-box }`; the padded blocks below rely on it. */
.abena-v3-modal--deduction-info .order-deduction-info *,
.abena-v3-modal--deduction-info .order-deduction-info *::before,
.abena-v3-modal--deduction-info .order-deduction-info *::after {
    box-sizing: border-box;
}

/* ---------- "Théorique : …" ---------- */
/* A bare line, not the deduct modal's bordered .ded-theo box: the mockup sets it flat on white,
   which is what separates a statement of fact from that dialog's call to action. */
.abena-v3-modal--deduction-info .odi-basis {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--sn-text-muted);
}

.abena-v3-modal--deduction-info .odi-basis > i {
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1.3;
}

/* ---------- Summary panel ---------- */
.abena-v3-modal--deduction-info .odi-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--odi-panel);
}

.abena-v3-modal--deduction-info .odi-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

.abena-v3-modal--deduction-info .odi-label {
    color: var(--sn-text-muted);
}

.abena-v3-modal--deduction-info .odi-value {
    text-align: right;
    font-weight: 700;
    color: var(--abena-color-page-title);
}

/* What the deduction took: the mockup's violet, on both the amount and its order equivalent. */
.abena-v3-modal--deduction-info .odi-value--deducted {
    color: var(--odi-accent);
}

/* The outcome, ruled off from what produced it. */
.abena-v3-modal--deduction-info .odi-row--total {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid #EAECF3;
}

.abena-v3-modal--deduction-info .odi-row--total .odi-label {
    font-weight: 700;
    color: var(--abena-color-page-title);
}

.abena-v3-modal--deduction-info .odi-row--total .odi-value {
    color: var(--odi-total);
}

/* ---------- Footer ---------- */
/* The destructive action sits alone on the left, the pair that closes on the right — the design's
   own layout. `margin-right:auto` rather than `space-between` so the two right-hand buttons keep
   the 8px gap the shared footer gives them when "Annuler la déduction" is withheld. */
.abena-v3-modal--deduction-info .abena-v3-modal__footer .odi-cancel {
    margin-right: auto;
}


/* ============================================================================
   Responsive overrides — the design's breakpoints for the order drawers.

   They live at the END of the sheet on purpose. A media query adds NO specificity, so a rule
   inside one only beats an equally specific base rule by coming after it. Written next to their
   own sections, `.abena-v3-slide-panel:is(…) { width: 100% }` (0,2,0) was silently outranked by
   `.abena-v3-slide-panel.article-details-drawer { width: 560px }` (0,2,0) declared 1800 lines
   below, and that drawer never resized at all. Keep new breakpoint rules here.

   Widest query first, which is also the order they should cascade in. Every `rem` in a media
   query resolves against the initial 16px, not the (scaled) root, so these fire at the stated
   pixel widths whatever `html.no-breakpoints` is doing.
   ============================================================================ */

/* Mock's `@media (max-width:1200px)` for the wide drawer: the panel widens, the hierarchy tree
   narrows, both panes lose gutter, and each row becomes two lines. 75rem == 1200px.

   DELIBERATE DEVIATION on the width — do NOT "fix" it back by reading the mock's stylesheet. That
   sheet computes to 94vw between 900 and 1200px (`.drawer`'s `max-width:94vw` caps `.drawer.wide`'s
   `width:96vw`) and 96vw below 900px, so on paper the panel keeps a gutter. The prototype as
   rendered reads edge to edge, and edge to edge is what was asked for. Above 1200px it stays on
   the mock's 1040px. */
@media (max-width: 75rem) {
    .abena-v3-slide-panel.order-catalog-drawer {
        width: 100%;
        max-width: 100%;
    }

    .order-catalog-drawer .cat-tree {
        width: 11.875rem; /* 190px — per design .cat-tree */
        padding: 1.5rem 0.875rem; /* 24px 14px */
    }

    .order-catalog-drawer .cat-right {
        padding: 1.5rem 1.25rem; /* 24px 20px — per design .cat-right */
    }

    /* Info / conditioning / price on the first line, the actions on a second line. The design's
       conditioning track is 136px; ours keeps the base rule's 10rem for the longer unit names. */
    .order-catalog-drawer .cat-row {
        grid-template-columns: minmax(0, 1fr) 10rem 12.375rem;
        gap: 0.625rem; /* 10px — per design .cat-row */
    }

    /* Centred across the row (the design right-aligns them in the first column). The stepper sits
       on the centre line: the two hover buttons on its left are mirrored by two empty tracks. */
    .order-catalog-drawer .cat-row-actions {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 2.125rem 2.125rem auto 2.125rem 2.125rem 1fr;
    }

    .order-catalog-drawer .cat-row-actions > :nth-child(1) {
        grid-column: 2;
    }

    .order-catalog-drawer .cat-row-actions > :nth-child(2) {
        grid-column: 3;
    }

    .order-catalog-drawer .cat-row-actions > :nth-child(3) {
        grid-column: 4;
    }
}

/* Mock's `.drawer` at 900px: a drawer stops being a panel laid over the page and takes the whole
   width, with tighter gutters. Stated once there, on `.drawer`, so written once here.

   The catalogue is deliberately absent — like the mock's `.drawer.wide` it keeps the width its own
   1200px block gives it. And this is NOT on the shared `.abena-v3-slide-panel` in Abena-v3.css:
   the Chambres / Resident panels come from a different mock (the `.rp-*` design system, absent
   from this one), so extending the rule to them is a call nobody has made.

   The create drawer's four type cards are deliberately NOT stacked: the mock's `.type-grid` one
   column rule is overridden by an inline two-column style on its own `#create-type-grid`, so it
   shows two columns at this width too. */
@media (max-width: 56.25rem) {
    .abena-v3-slide-panel:is(.new-order-panel, .article-details-drawer, .order-history-drawer) {
        width: 100%;
        max-width: 100%;
    }

    .abena-v3-slide-panel:is(.new-order-panel, .article-details-drawer, .order-history-drawer) .abena-v3-slide-panel__header {
        gap: 0.875rem; /* 14px — per design .drawer-header */
        padding: 0.875rem 1.25rem; /* 14px 20px */
    }

    .abena-v3-slide-panel:is(.new-order-panel, .article-details-drawer, .order-history-drawer) .abena-v3-slide-panel__body {
        padding: 1.25rem; /* 20px — per design .drawer-body */
    }

    .abena-v3-slide-panel:is(.new-order-panel, .article-details-drawer, .order-history-drawer) .abena-v3-slide-panel__footer {
        padding: 1rem 1.25rem 1.25rem; /* Sides and bottom per design; the top keeps the base 16px,
                                          because these footers sit under the shared border-top. */
    }

    /* Except the create drawer, which removes that border, so it takes the design's
       `.drawer-footer` zero top padding literally. Equal specificity to the rule above — it wins
       on source order. */
    .abena-v3-slide-panel.new-order-panel .abena-v3-slide-panel__footer {
        padding-top: 0;
    }

    /* Mock's `.input-row.cols-2` collapses to one column. Keeps the shared row's 8px gap rather
       than the mock's 12px — that difference is pre-existing at every width and shared with
       EditRoom / AddChambre, so it is not this fix's to change. */
    .new-order-panel .abena-v3-form__row {
        flex-direction: column;
    }
}

/* Mock's `@media (max-width:520px)` (`.fiche-box-cols` / `.fiche-visuals`, line 5251). 32.5rem ==
   520px, against the 30rem this used to sit at; and it only carried the two-column rule, with no
   counterpart for the visuals. */
@media (max-width: 32.5rem) {
    .article-details-drawer .ad-two-col {
        grid-template-columns: 1fr;
    }

    .article-details-drawer .ad-visuals {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Traitée pill: teal ink for text contrast. */
.order-main-page .res-badge.is-teal,
.order-edit-page .res-badge.is-teal {
    color: var(--color-teal-ink);
}
