/* Stage 1.16 (the night of 17→18 Oct): the layout of the pages of one zone (Marketplace, Panou Client, Clienți, Catalog, Sarcini, the Panou with Personalizează), after the common pieces (ace-panel-ui.css).
   Only the arrangement (grid, flex, gaps, widths) under the page's own class, and only with the theme's tokens (var(--acs-*)): no colors,
   no shadows, no radii of its own. What two zones need becomes a common piece. */

/* Clienți and Catalog (P-Clienti, P-Catalog): the box that ticks a row sits left of the name; under the table, the list's tools on one
   line that wraps, the action for the rows ticked with its button. */
body[data-ace-theme-scope="acpanel"] .ace-biz-pick {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
}
/* Stage 1.16b (18 Oct; VERIFICARE-1-LA-1.md 2.4): the row over a list: the pills of one choice, the search and the filters, then at its
   right "Vizualizare: Tabel ▾" and "⋯"; their menus open under them. */
body[data-ace-theme-scope="acpanel"] .ace-biz-list-card {
    display: grid;
    gap: var(--acs-space-3);
    padding: var(--acs-space-4) var(--acs-space-5);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--acs-space-3);
    margin: 0 0 var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-bar > .ace-ui-chips {
    flex: 1 1 100%;
}
/* Stage 1.16b (P-Clienti): the pills of one choice on the right of the card's first row, next to "Vizualizare" and "⋯"; the search and
   the other filters on the row under them. */
body[data-ace-theme-scope="acpanel"] .ace-biz-list-bar__end > .ace-ui-chips {
    margin: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-card .ace-biz-list-bar__end {
    order: -1;
    flex: 1 1 100%;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-card .ace-biz-list-bar > .ace-c-filters {
    flex: 1 1 100%;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-bar > .ace-c-filters {
    flex: 1 1 420px;
    margin: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-bar__end {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: var(--acs-space-2);
    margin-left: auto;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-menu {
    position: relative;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-menu > summary {
    list-style: none;
    cursor: pointer;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-menu > summary::-webkit-details-marker {
    display: none;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--acs-space-3) var(--acs-space-4);
    margin: var(--acs-space-4) 0 var(--acs-space-5);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-list-tools > .ace-ui-chips {
    flex: 1 1 100%;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--acs-space-2) var(--acs-space-3);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-bulk .ace-c-field {
    width: 240px;
    max-width: 100%;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-total {
    margin: 0;
}
/* A client's form (DE-FACUT.md 6.4): the CUI with "Caută în ANAF" beside it, the help and what ANAF answered under them. */
body[data-ace-theme-scope="acpanel"] .ace-biz-anaf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--acs-space-2) var(--acs-space-3);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-anaf > label {
    flex: 0 1 240px;
}
body[data-ace-theme-scope="acpanel"] .acp-form-grid > .ace-biz-anaf {
    grid-column: 1 / -1;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-anaf > small,
body[data-ace-theme-scope="acpanel"] .ace-biz-anaf > p {
    flex: 1 1 100%;
    margin: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-anaf > p:empty {
    display: none;
}
/* The product form: the switch "Prețul include TVA" next to its words. */
body[data-ace-theme-scope="acpanel"] .ace-biz-switch-row {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
}

/* ADMINISTRARE → Prezentare (P-Admin): the figures with their note beside the value; each area's tile with its icon, its name and line
   beside it and its state on the right, then what is to know and "Deschide" across it. */
body[data-ace-theme-scope="acpanel"] .ace-biz-admin .ace-c-stats .ace-c-tile {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--acs-space-2);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-admin .ace-c-stats .ace-c-tile-label {
    flex: 1 1 100%;
}
/* An area's card (the shared Ui::card with its icon): its text, then "Deschide" across it. */
body[data-ace-theme-scope="acpanel"] .ace-biz-admin .ace-c-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--acs-space-3);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-admin .ace-c-card-body > p {
    flex: 1 1 auto;
    margin: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-admin .ace-c-card-body > .ace-c-btn {
    justify-content: center;
    width: 100%;
}

/* Notificări (P-Notificari): a row's "Marchează citită" and "Deschide" side by side. */
body[data-ace-theme-scope="acpanel"] .ace-biz-notify .ace-c-row-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Automatizări (P-Automatizari): a row's actions on one line ("Șterge" the quiet red word of every table, Stage 1.16e round 5). */
body[data-ace-theme-scope="acpanel"] .ace-biz-auto .ace-c-row-actions {
    flex-wrap: nowrap;
    align-items: center;
}

/* Automatizări → Rețete (P-Automatizari-Retete): the recipes three a row (two on a tablet, one on a phone), "Pornește" across the card. */
body[data-ace-theme-scope="acpanel"] .ace-biz-recipes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--acs-space-4);
    margin-top: var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-recipe-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--acs-space-2);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-recipe-start {
    flex: 1 1 100%;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-recipe-start .ace-c-btn {
    justify-content: center;
    width: 100%;
}
@media (max-width: 1100px) {
    body[data-ace-theme-scope="acpanel"] .ace-biz-recipes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    body[data-ace-theme-scope="acpanel"] .ace-biz-recipes {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A rule (P-AutoRegula): Când · Dacă · Atunci side by side, their rows one field under another; one under another under 1100 px. */
body[data-ace-theme-scope="acpanel"] .ace-biz-rule-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--acs-space-4);
    align-items: start;
    margin-bottom: var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-rule-steps > .acp-card {
    min-width: 0;
    margin: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-rule-steps .ace-ui-rule-row,
body[data-ace-theme-scope="acpanel"] .ace-biz-rule-steps .acp-form-grid {
    grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 1100px) {
    body[data-ace-theme-scope="acpanel"] .ace-biz-rule-steps {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A message's template (P-SablonMesaj): the variables on the right, each with "Pune" on its row. */
body[data-ace-theme-scope="acpanel"] .ace-biz-template-side {
    display: grid;
    gap: var(--acs-space-4);
    align-content: start;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-variables li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--acs-space-3);
    padding: var(--acs-space-2) 0;
}

/* Mesaje (P-Mesaje): the list on the left (400 px), the message read on the right; one under the other under 900 px. */
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: var(--acs-space-4);
    align-items: start;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox > .acp-card {
    margin: 0;
    min-width: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__rows {
    list-style: none;
    margin: 0;
    padding: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--acs-space-3);
    row-gap: 2px;
    padding: var(--acs-space-3) var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__row .ace-biz-avatar {
    grid-row: span 2;
    align-self: center;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__who,
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__line {
    display: flex;
    align-items: center;
    gap: var(--acs-space-2);
    min-width: 0;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__who strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__line > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__head {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
    margin-bottom: var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__text {
    padding: var(--acs-space-3) var(--acs-space-4);
    margin-bottom: var(--acs-space-4);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--acs-space-2);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-inbox__actions form {
    margin: 0;
}
@media (max-width: 900px) {
    body[data-ace-theme-scope="acpanel"] .ace-biz-inbox {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A row's two buttons side by side (Aprobări: Respinge · Aprobă). */
body[data-ace-theme-scope="acpanel"] .ace-biz-row-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: var(--acs-space-2);
}
body[data-ace-theme-scope="acpanel"] .ace-biz-row-actions form {
    margin: 0;
}

/* Panou Client (C-SidebarClient): the cards of the site and of the account on top of the menu, the avatar left of the two lines. */
body[data-ace-panel="cpanel"] .ace-biz-side-card {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
    margin: 0 var(--acs-space-3) var(--acs-space-2);
}
/* Stage 1.16b (C-SidebarClient): the menu a column, its foot at the bottom under a thin line; a thin line before DIN MODULE. */
body[data-ace-panel="cpanel"] .ace-biz-side {
    display: flex;
    flex-direction: column;
}
body[data-ace-panel="cpanel"] .ace-biz-side > .acp-nav:not(.ace-biz-side-foot) {
    flex: 1 1 auto;
    align-content: start;
}
body[data-ace-panel="cpanel"] .ace-biz-side-foot {
    flex: 0 0 auto;
    margin: var(--acs-space-3) 0 0;
    padding-top: var(--acs-space-3);
    border-top: 1px solid var(--acs-sidebar-line, var(--acs-border));
}
body[data-ace-panel="cpanel"] .ace-biz-side-line {
    margin: var(--acs-space-3) var(--acs-space-3);
    border: 0;
    border-top: 1px solid var(--acs-sidebar-line, var(--acs-border));
}
body[data-ace-panel="cpanel"] .ace-biz-side-brand {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
    padding: var(--acs-space-2) var(--acs-space-2) var(--acs-space-4);
    color: var(--acs-text);
    text-decoration: none;
}
body[data-ace-panel="cpanel"] .ace-biz-side-user {
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
}
body[data-ace-panel="cpanel"] .ace-biz-side-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
/* (Stage 1.16e, round 6: the scale's sizes, the firm's name a title's, its address the secondary text's.) */
body[data-ace-panel="cpanel"] .ace-biz-side-copy strong {
    font-size: var(--acs-fs-title);
}
body[data-ace-panel="cpanel"] .ace-biz-side-copy small {
    font-size: var(--acs-fs-sm);
}
:root[data-ace-theme] body[data-ace-panel="cpanel"] .ace-c-btn.ace-biz-side-out {
    justify-content: flex-start;
    display: flex;
    align-items: center;
    gap: var(--acs-space-3);
    width: 100%;
    font-size: var(--acs-fs);
}
