/* ============================================================
   The back office's own components — only what the core's base.css does not have (prefix ws-).
   No raw colour here: tokens of the theme only (core/docs/UI.md).
   ============================================================ */

/* a narrow list on the left, the work on the right (Users & roles: roles | matrix) */
.ws-grid-aside { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
@media (max-width: 1024px) { .ws-grid-aside { grid-template-columns: minmax(0, 1fr); } }

.ws-menu-form { padding: var(--core-sp-2) var(--core-sp-3); }

/* the state dot in front of a line of a list (Needs attention) — step 500 of the state's band */
.ws-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--core-accent); }
.ws-dot-ok { background: var(--core-ok); }
.ws-dot-warn { background: var(--core-warn); }
.ws-dot-danger { background: var(--core-danger); }

/* a list to pick one item from (the roles of Users & roles): compact rows, the chosen one tinted like the active menu item */
.ws-pick { display: flex; flex-direction: column; gap: 2px; }
.ws-pick-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--core-radius-sm); color: var(--core-text); text-decoration: none; font-size: 0.875rem; }
.ws-pick-item:hover { background: var(--core-hover); }
.ws-pick-item.is-selected { background: var(--core-accent-soft); color: var(--core-accent-text); font-weight: 600; }
.ws-pick-count { color: var(--core-text-3); font-size: 0.8rem; }

/* the rights matrix: the level radios wear the accent */
.ws-matrix input[type="radio"] { accent-color: var(--core-accent); width: 16px; height: 16px; }

/* the start wizard: a centred column on the bare shell */
.ws-wizard { max-width: 780px; margin: var(--core-sp-6) auto; }
.ws-layout-mini { display: grid; gap: 3px; width: 72px; height: 48px; padding: 4px; border: 1px solid var(--core-border); border-radius: var(--core-radius-sm); flex: 0 0 auto; }
.ws-layout-mini i { display: block; background: var(--core-accent-soft-2); border-radius: 2px; }
.ws-layout-retail { grid-template-rows: 2fr 1fr 1fr; }
.ws-layout-editorial { grid-template-rows: 3fr 1fr; }
.ws-layout-editorial i:nth-child(3) { display: none; }
.ws-layout-catalog { grid-template-columns: 1fr 3fr; grid-template-rows: 1fr 1fr; }
.ws-layout-catalog i:first-child { grid-row: span 2; }
.ws-layout-showcase { grid-template-rows: 1fr 2fr 1fr; }
.ws-layout-split { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; }
.ws-layout-split i:nth-child(3) { grid-column: span 2; }
.ws-layout-market { grid-template-columns: 2fr 1fr; grid-template-rows: 2fr 1fr; }
.ws-layout-market i:nth-child(3) { grid-column: span 2; }
.ws-layout-minimal { grid-template-rows: 2fr 1fr 1fr; gap: 4px; }
.ws-layout-minimal i:nth-child(n+2) { height: 2px; align-self: center; }
.ws-layout-mosaic { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.ws-layout-mosaic i:first-child { grid-row: span 2; }

/* Design & brand: the ready-made looks, each drawn small in its own colours */
.ws-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--core-sp-3); }
.ws-look { display: flex; flex-direction: column; gap: 8px; padding: var(--core-sp-3); border: 1px solid var(--core-border); border-radius: var(--core-radius-md); }
.ws-look-mini { display: block; width: 100%; height: auto; border-radius: var(--core-radius-sm); border: 1px solid var(--core-border); }
.ws-look .core-btn { align-self: flex-start; }
.ws-choices-list { grid-template-columns: minmax(0, 1fr); }
.ws-wizard .core-steps a { color: inherit; text-decoration: none; }
.ws-wizard-title { font-size: 1.3rem; font-weight: 600; margin: 0 0 var(--core-sp-1); letter-spacing: -0.01em; }
.ws-plans { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- catalog ---------- */
/* the product cell of a list: thumbnail, name, code */
.ws-product-cell { display: flex; align-items: center; gap: var(--core-sp-3); color: inherit; text-decoration: none; }
.ws-product-cell:hover .core-cell-primary { color: var(--core-accent-text); }
.ws-thumb { width: 40px; height: 40px; border-radius: var(--core-radius-sm); object-fit: cover; flex: 0 0 auto; border: 1px solid var(--core-border); background: var(--core-surface-2); }
.ws-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--core-text-3); }
/* a product without a photo: the shop's logo, small and softened (or the shop's own picture) */
.ws-thumb-logo { object-fit: contain; padding: 6px; opacity: .55; }
.ws-thumb-own { object-fit: cover; padding: 0; opacity: 1; }
.ws-select-icon { min-width: 130px; }
.ws-input-name { min-width: 150px; }
.ws-values-table { table-layout: fixed; }
.ws-values-table th:first-child { width: 24%; }
/* the images of a product */
.ws-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--core-sp-2); }
.ws-image { position: relative; margin: 0; aspect-ratio: 1; border: 1px solid var(--core-border); border-radius: var(--core-radius-sm); overflow: hidden; background: var(--core-surface-2); }
.ws-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-image figcaption { position: absolute; left: 4px; bottom: 4px; }
.ws-image .core-btn { position: absolute; top: 4px; right: 4px; background: var(--core-surface); }
.ws-attr-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ws-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; }   /* fixed choices ticked on the product (the allergens) */
.ws-field-wide { grid-column: 1 / -1; }
.ws-num-input { width: 110px; text-align: right; margin-left: auto; }
.ws-unit-input { width: 72px; }
/* the ProductType board: the ticks, the filter kind under the Filter tick, the card preview */
.ws-type-table td { vertical-align: top; }
.ws-type-table th { white-space: normal; }   /* long headings on two lines: the variant column fits beside the others */
.ws-type-table .core-check { justify-content: center; }
.ws-filter-kind { margin-top: 6px; width: auto; }
.ws-type-table .core-select-sm { min-width: 88px; }   /* kind, filter, variant: readable; the table scrolls sideways when it must */
.ws-type-table td:first-child .core-input { min-width: 110px; }
.ws-type-table td:nth-child(3) .core-input { width: 100px; }   /* the group: short words, room for the variant column */
.ws-type-table .ws-filter-kind { width: 104px; min-width: 0; }
.ws-type-table .ws-variant-look { min-width: 118px; }
.ws-card-preview { max-width: 260px; border: 1px solid var(--core-border); border-radius: var(--core-radius); padding: var(--core-sp-3); display: flex; flex-direction: column; gap: var(--core-sp-2); background: var(--core-surface); }
.ws-card-preview-img { aspect-ratio: 4 / 3; border-radius: var(--core-radius-sm); background: var(--core-surface-2); display: flex; align-items: center; justify-content: center; color: var(--core-text-3); overflow: hidden; }
.ws-card-preview-img img { width: 100%; height: 100%; object-fit: cover; }
.ws-card-preview-name { font-size: var(--core-fs-ctl); }
/* the ImportProfile board */
.ws-step-link { color: inherit; text-decoration: none; }
.ws-samples { max-width: 260px; }
.ws-source-kinds { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

/* a select that keeps its natural width inside a toolbar or a row */
.ws-auto { width: auto; }

/* ---------- order windows ---------- */
/* the four moments of a window, each with its colour stripe (OrderWindows board) */
.ws-deadlines { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--core-sp-3); }
.ws-deadline { border: 1px solid var(--core-border); border-top-width: 3px; border-radius: var(--core-radius-sm); padding: var(--core-sp-3); }
.ws-dl-1 { border-top-color: var(--core-border-strong); }
.ws-dl-2 { border-top-color: var(--core-accent); }
.ws-dl-3 { border-top-color: var(--core-warn); }
.ws-dl-4 { border-top-color: var(--core-ok); }
.ws-deadline-value { font-weight: 600; font-size: var(--core-fs-ctl); }
.ws-late { border: 1px solid var(--core-border); border-radius: var(--core-radius-sm); padding: var(--core-sp-3); }
.ws-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--core-sp-3); }
.ws-pos-input { width: 64px; text-align: right; margin-left: auto; }
/* a registration waiting for its group: who on the left, the decision on the right (Registrations board) */
.ws-reg { display: flex; justify-content: space-between; gap: var(--core-sp-4); padding: var(--core-sp-4) var(--core-card-pad); border-bottom: 1px solid var(--core-border); flex-wrap: wrap; }
.ws-reg:last-child { border-bottom: 0; }
.ws-reg-who, .ws-reg-act { display: flex; flex-direction: column; gap: 4px; }
.ws-reg-act { gap: var(--core-sp-2); align-items: flex-end; }
.ws-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ws-fieldset .core-seg { flex-wrap: wrap; }   /* eight home layouts: a second row rather than out of the card */

/* the DeliveryPlan board: one column per route, the stops in sequence; a stop moved this week is tinted; drag to move */
.ws-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--core-sp-4); align-items: start; }
.ws-plan-stops { list-style: none; margin: 0; padding: var(--core-sp-3); display: flex; flex-direction: column; gap: var(--core-sp-2); min-height: 64px; }
.ws-plan-stops.is-over { background: var(--core-accent-soft); }
.ws-stop { display: flex; gap: var(--core-sp-3); align-items: flex-start; padding: var(--core-sp-3); border-radius: var(--core-radius-md); background: var(--core-surface); box-shadow: inset 0 0 0 1px var(--core-border); }
.ws-stop[draggable="true"] { cursor: grab; }
.ws-stop.is-dragging { opacity: .5; }
.ws-stop-moved { background: var(--core-warn-bg); box-shadow: inset 0 0 0 1px var(--core-warn-border); }
.ws-stop-n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--core-fs-xs); font-weight: 600; background: var(--core-surface-2); color: var(--core-text-2); }
.ws-stop-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.ws-stop-meta { font-size: var(--core-fs-xs); color: var(--core-text-2); }
.ws-legend { display: inline-flex; align-items: center; gap: var(--core-sp-2); font-size: var(--core-fs-sm); color: var(--core-text-2); }
.ws-legend-swatch { width: 14px; height: 14px; border-radius: var(--core-radius-sm); background: var(--core-warn-bg); box-shadow: inset 0 0 0 1px var(--core-warn-border); }
.ws-week { font-weight: 600; min-width: 150px; text-align: center; }

/* the StorefrontConfig board: segmented choices made of radios, the logo and the colour inputs */
.core-seg-btn:has(input:checked) { background: var(--core-seg-active-bg); color: var(--core-text); box-shadow: var(--core-shadow-sm); font-weight: 600; }
.core-seg-btn:has(input:focus-visible) { outline: var(--core-focus-w) solid var(--core-focus); }
.ws-logo-preview { max-height: 56px; max-width: 160px; object-fit: contain; }
.ws-color { width: 72px; padding: 2px; }
.ws-code { width: 100%; min-height: 96px; font-family: var(--core-font-mono); font-size: var(--core-fs-xs); }
/* Settings → Languages: the rules of the translation add-on */
.ws-bullets { margin: 0; padding-left: 1.2em; display: grid; gap: var(--core-sp-1); color: var(--core-text-2); }
/* Settings → Notifications: the area rows of the events table, the selected event, placeholders, the mail preview */
.ws-group-row th { background: var(--core-surface-2); color: var(--core-text-3); font-size: var(--core-fs-xs); text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.core-table tr[aria-current="true"] td { background: var(--core-accent-soft); }
.ws-code-chip { font-family: var(--core-font-mono); font-size: var(--core-fs-xs); padding: 2px 6px; border-radius: var(--core-radius-sm); background: var(--core-surface-2); border: 1px solid var(--core-border); }
.ws-mail { border: 1px solid var(--core-border); border-radius: var(--core-radius-md); overflow: hidden; background: var(--core-surface-2); }
.ws-mail-bar { padding: var(--core-sp-3) var(--core-sp-4); background: var(--core-accent); color: var(--core-on-accent); font-weight: 600; }
.ws-mail-body { margin: var(--core-sp-4); padding: var(--core-sp-4); background: var(--core-surface); border-radius: var(--core-radius-sm); display: grid; gap: var(--core-sp-2); }
.ws-mail-body p { margin: 0; }
.ws-mail-title { font-size: var(--core-fs-ctl); }
.ws-mail-btn { justify-self: start; margin-top: var(--core-sp-2); padding: var(--core-sp-2) var(--core-sp-4); border-radius: var(--core-radius-sm); background: var(--core-accent); color: var(--core-on-accent); font-weight: 600; }
.ws-mail-foot { margin: 0 var(--core-sp-4) var(--core-sp-4); color: var(--core-text-3); font-size: var(--core-fs-xs); }

/* a product's variants: one field of values per axis, side by side */
.ws-variant-axes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--core-sp-3); }
