/* Shared component classes of the product (FD3): the action system (UI-NAV-001) and the collection standard as classes that a module
   bundle can use instead of drawing its own. Built ONLY on var(--croo-*) of shell/tokens.css: no colour, size or radius literal here, so a
   change of the approved mockup is a change of a token value and reaches every module at once. Values are those of the single mockup at r10.1
   (layout-standard.css with the accessibility stylesheet r10-a11y-v1.css): 36px controls, orange primary with dark text, one focus ring,
   field borders at 3:1, table head 11px 500 on 12px 16px, cells 14px 16px, tabs selected #b74a00 with a 2px orange line, one chip.
   The contract for module authors is docs/modules/ui-components.md. Naming: block, then --modifier, then __element (BEM, prefix croo-).
   Specificity is one class: a module may refine a component with its own scoped rule. Nothing here is scoped to the shell frame, so the
   classes work in a module slot, on a shell page and in a state page alike. */

/* Focus: the one ring of the product (r10: 2px, offset 3px, #c84f00 token) */
:is(.croo-button,.croo-back,.croo-input,.croo-select,.croo-tabs>*,.croo-table a,.croo-filters :is(input,select)):focus-visible{outline:var(--croo-focus-width) solid var(--croo-focus);outline-offset:var(--croo-focus-offset)}

/* Buttons */
.croo-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;min-height:var(--croo-control-36);margin:0;padding:8px 12px;border:1px solid var(--croo-button-line);border-radius:var(--croo-radius-button);background:var(--croo-page);color:var(--croo-ink);font:var(--croo-weight-medium) var(--croo-size-12)/18px var(--croo-font-body);text-decoration:none;white-space:nowrap;cursor:pointer}
.croo-button:hover{background:var(--croo-button-hover-bg);border-color:var(--croo-button-hover-line)}
.croo-button--primary{background:var(--croo-accent);border-color:var(--croo-accent);color:var(--croo-accent-text)}
.croo-button--primary:hover{background:var(--croo-accent-hover);border-color:var(--croo-accent-hover)}
.croo-button--danger{border-color:var(--croo-danger-line);color:var(--croo-danger)}
.croo-button--danger:hover{background:var(--croo-danger-hover-bg);border-color:var(--croo-danger-hover-line)}
.croo-button--quiet{border-color:transparent;background:transparent;color:var(--croo-quiet-ink)}
.croo-button--quiet:hover{background:var(--croo-button-hover-bg);border-color:var(--croo-button-hover-bg)}
.croo-button:is(:disabled,[aria-disabled="true"]){background:var(--croo-disabled-bg);border-color:var(--croo-disabled-line);color:var(--croo-muted-tint);cursor:not-allowed}

/* Back: the bordered button with its arrow, in the page header (Article XIV: detail pages are full pages) */
.croo-back{display:inline-flex;align-items:center;gap:6px;box-sizing:border-box;min-height:var(--croo-control-36);padding:0 12px;border:1px solid var(--croo-button-line);border-radius:var(--croo-radius-button);background:var(--croo-page);color:var(--croo-ink);font:var(--croo-weight-medium) var(--croo-size-12)/18px var(--croo-font-body);text-decoration:none;cursor:pointer}
.croo-back:hover{background:var(--croo-button-hover-bg);border-color:var(--croo-button-hover-line)}

/* Fields: 36px, radius 6, border at 3:1 (the border is the only cue that a field is a field) */
.croo-input,.croo-select{box-sizing:border-box;min-height:var(--croo-control-36);padding:9px 11px;border:1px solid var(--croo-field-line);border-radius:var(--croo-radius-field);background:var(--croo-page);color:var(--croo-ink);font:var(--croo-weight-regular) var(--croo-size-13) var(--croo-font-body)}
.croo-input[aria-invalid="true"],.croo-select[aria-invalid="true"]{border-color:var(--croo-danger)}

/* Table: one density. The collection variant is the list standard (name 24%, information, actions 25%); the compact variant top-aligns cells. */
.croo-table-wrap{border:1px solid var(--croo-line);border-radius:var(--croo-radius-collection);background:var(--croo-page);overflow-x:auto}
.croo-table{width:100%;border-collapse:collapse;font-size:var(--croo-size-12)}
.croo-table th{padding:var(--croo-head-y) var(--croo-cell-x);background:var(--croo-table-head-bg);border-bottom:1px solid var(--croo-line);color:var(--croo-muted-tint);font:var(--croo-weight-medium) var(--croo-size-11)/1.5 var(--croo-font-body);text-align:left}
.croo-table td{padding:var(--croo-cell-y) var(--croo-cell-x);border-bottom:1px solid var(--croo-line);vertical-align:middle}
.croo-table tbody tr:last-child td{border-bottom:0}
.croo-table tbody tr:hover{background:var(--croo-table-row-hover)}
.croo-table a{color:var(--croo-link)}
.croo-table--collection{table-layout:fixed;min-width:680px}
.croo-table--collection th:first-child{width:24%}
.croo-table--collection th:last-child{width:25%}
.croo-table--compact td{vertical-align:top}

/* Tabs: a row of links or buttons; the selected one carries aria-current or aria-selected */
.croo-tabs{display:flex;gap:4px;padding:0 var(--croo-gutter);border-bottom:1px solid var(--croo-line)}
.croo-tabs>*{display:inline-flex;align-items:center;box-sizing:border-box;min-height:50px;padding:0 14px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--croo-muted);font:var(--croo-weight-medium) var(--croo-size-13) var(--croo-font-body);text-decoration:none;cursor:pointer}
.croo-tabs>:first-child{padding-left:2px}   /* r10.3: the first label sits 2px from the page title's left edge, as the mockup draws it */
.croo-tabs>:is([aria-current],[aria-selected="true"]){color:var(--croo-tab-ink);border-bottom-color:var(--croo-accent);font-weight:var(--croo-weight-strong)}

/* Badges and the one chip */
.croo-badge{display:inline-block;padding:4px 7px;border-radius:var(--croo-radius-badge);background:var(--croo-neutral-badge-bg);color:var(--croo-neutral-badge);font-size:var(--croo-size-11);line-height:16px}
.croo-badge--on{background:var(--croo-success-bg);color:var(--croo-success)}
.croo-badge--warn{background:var(--croo-warn-bg);color:var(--croo-warn)}
.croo-badge--soon{padding:3px 9px;border-radius:var(--croo-radius-chip);background:var(--croo-warn-bg);color:var(--croo-warn);font-weight:var(--croo-weight-medium);letter-spacing:.2px;line-height:1.2}

/* Panel and empty state */
.croo-panel{box-sizing:border-box;min-width:0;padding:20px;border:1px solid var(--croo-line);border-radius:var(--croo-radius-panel);background:var(--croo-page)}
.croo-empty{padding:32px;border:1px solid var(--croo-line);border-radius:var(--croo-radius-panel);color:var(--croo-muted);text-align:center}

/* Page header: full bleed, min 66px, title Jost 550 19px, subtitle and eyebrow at the 11px floor */
.croo-page-header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:var(--croo-header-min);padding:10px var(--croo-gutter);background:var(--croo-page);border-bottom:1px solid var(--croo-line)}
.croo-page-header__eyebrow{margin:0 0 3px;color:var(--croo-eyebrow);font-size:var(--croo-size-11);letter-spacing:var(--croo-letter-eyebrow);text-transform:uppercase}
.croo-page-header__title{margin:0;color:var(--croo-ink);font:var(--croo-weight-title) var(--croo-size-19)/1.3 var(--croo-font-title);letter-spacing:-.4px}
.croo-page-header__subtitle{margin:3px 0 0;color:var(--croo-muted);font-size:var(--croo-size-11);line-height:1.5}
.croo-page-header__actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}

/* Filter bar: fields and buttons share the one height */
.croo-filters{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.croo-filters :is(input,select,.croo-button){min-height:var(--croo-control-36)}

/* Metrics: one bordered box split in cells */
.croo-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));overflow:hidden;border:1px solid var(--croo-line);border-radius:var(--croo-radius-panel);background:var(--croo-page)}
.croo-metrics>*{min-width:0;padding:20px;border-right:1px solid var(--croo-line)}
.croo-metrics>:last-child{border-right:0}
.croo-metrics__value{display:block;margin:8px 0 4px;font:var(--croo-weight-medium) var(--croo-size-29)/1.3 var(--croo-font-title);letter-spacing:-.7px}
.croo-metrics__label{color:var(--croo-muted);font-size:var(--croo-size-11)}

@media (max-width:640px){
  .croo-table:has(td[data-label]){display:block;min-width:0;table-layout:auto}
  .croo-table:has(td[data-label]) thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .croo-table:has(td[data-label]) :is(tbody,tr){display:block;width:100%}
  .croo-table:has(td[data-label]) tr{padding:10px 0;border-bottom:1px solid var(--croo-line)}
  .croo-table:has(td[data-label]) tbody tr:last-child{border-bottom:0}
  .croo-table:has(td[data-label]) td{display:block;padding:5px var(--croo-cell-x);border:0}
  .croo-table:has(td[data-label]) td[data-label]::before{content:attr(data-label);display:block;margin-bottom:2px;color:var(--croo-muted);font-size:var(--croo-size-11);font-weight:var(--croo-weight-strong)}
  .croo-table:has(td[data-label]) td:first-child{font-weight:var(--croo-weight-strong)}
  .croo-table:has(td[data-label]) td:first-child::before{display:none}
  .croo-table-wrap{overflow-x:visible}
  .croo-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .croo-metrics>:nth-child(2n){border-right:0}
  .croo-metrics>:nth-child(n+3){border-top:1px solid var(--croo-line)}
}
