/* Shared shell and record tables adapted from the OMS workspace components. */
:root {
  --edge-surface: var(--panel);
  --edge-border: var(--line);
  --edge-accent: var(--brand-ink);
  --edge-text: var(--ink);
  --edge-muted: var(--muted);
  --edge-gutter: clamp(.85rem, 2.3vw, 2.1rem);
  --directory-columns: 3rem minmax(0, 1fr) 9rem 2rem;
  --directory-gap: 1rem;
  --directory-gutter: clamp(1rem, 2.2vw, 1.65rem);
}
[hidden] { display: none !important; }
.edge-topbar { z-index: 20; }
.skip-link { z-index: 21; }
.workspace:focus { outline: none; }
.edge-topbar-inner, .edge-nav {
  width: 100%; min-width: 0; padding-inline: var(--edge-gutter);
}
.edge-topbar-inner { display: flex; align-items: center; gap: .8rem; min-height: 3.5rem; }
.edge-brand { flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; }
.edge-brand img { width: 1.82rem; height: 1.5rem; object-fit: contain; }
.edge-brand span { font-size: 1rem; font-weight: 700; letter-spacing: -.045em; }
.edge-divider { width: 1px; height: 1.25rem; background: var(--line); }
.edge-edition, .edge-switch-button { font-size: .86rem; font-weight: 550; }
.edge-edition { color: var(--muted); }
.edge-tools { display: flex; gap: .4rem; align-items: center; margin-inline-start: auto; }
.edge-demo, .edge-system { display: inline-flex; align-items: center; white-space: nowrap; font: 500 .68rem/1.4 var(--mono); color: var(--muted); }
.edge-demo { padding: .2rem .43rem; border: 1px solid var(--line); border-radius: .32rem; }
.edge-popover { position: relative; }
.edge-popover summary, .edge-secondary-actions summary, .edge-metrics summary { cursor: pointer; list-style: none; }
.edge-popover summary::-webkit-details-marker, .edge-secondary-actions summary::-webkit-details-marker, .edge-metrics summary::-webkit-details-marker { display: none; }
.edge-switch-button, .edge-account-button, .edge-tools .theme-toggle {
  min-height: 2.75rem; display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .55rem;
  border: 1px solid transparent; border-radius: .4rem; background: transparent; color: var(--ink);
}
.edge-switch-button .icon:first-child { width: 1rem; color: var(--muted); }
.edge-switch-button .icon:last-child, .edge-account-button .icon { width: .8rem; color: var(--muted); }
.edge-switch[open] .edge-switch-button .icon:last-child, .edge-account[open] .edge-account-button .icon { transform: rotate(180deg); }
.edge-popover[open] summary, .edge-popover summary:hover, .edge-tools .theme-toggle:hover { background: var(--raised); }
.edge-account-button .avatar { width: 1.8rem; height: 1.8rem; border-radius: 50%; color: var(--brand-ink); background: var(--brand-tint); font: 500 .7rem var(--mono); }
.edge-account-button .chip-display-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; }
.edge-tools .theme-toggle { justify-content: center; width: 2.75rem; color: var(--muted); }
.edge-popover-body {
  position: absolute; width: max-content; min-width: 13rem; max-width: min(18rem, 88vw); top: calc(100% + .25rem); left: 0;
  padding: .35rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--panel); box-shadow: 0 .5rem 1.5rem var(--shadow);
}
.edge-account .edge-popover-body { right: 0; left: auto; }
.edge-account-label { display: grid; gap: .12rem; padding: .55rem .65rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; overflow-wrap: anywhere; }
.edge-account-label strong { font-size: .89rem; }
.edge-account-label span { color: var(--muted); font: .74rem var(--mono); }
.edge-popover-body a, .edge-popover-body button {
  min-height: 2.75rem; width: 100%; display: flex; align-items: center; gap: .65rem;
  border: 0; border-radius: .35rem; background: transparent; color: var(--ink);
  text-decoration: none; padding: .48rem .65rem; font: inherit; font-size: .87rem; cursor: pointer;
}
.edge-popover-body a:is(:hover, [aria-current]), .edge-popover-body button:hover { background: var(--raised); }
.edge-popover-body .icon { width: 1rem; height: 1rem; color: var(--muted); }
.edge-popover-body a[aria-current] .icon:last-child { margin-left: auto; color: var(--brand-ink); }
.edge-account .edge-popover-body button { border-top: 1px solid var(--line); border-radius: 0 0 .32rem .32rem; margin-top: .2rem; }
.edge-nav { display: flex; overflow-x: auto; align-items: stretch; gap: 1.1rem; scrollbar-width: thin; }
.edge-nav button {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); padding: .45rem .1rem; font: 550 .84rem var(--sans); cursor: pointer;
}
.edge-nav button[aria-current] { border-bottom-color: var(--vermilion); color: var(--brand-ink); font-weight: 680; }
.edge-nav button:hover { color: var(--ink); }
.edge-nav button:focus-visible, .edge-tabs a:focus-visible { outline-offset: -3px; }
.edge-nav .icon { width: .97rem; height: .97rem; }
@media screen { .workspace { padding-inline: var(--edge-gutter); } }
.edge-home { margin-block-start: clamp(.75rem, 2.5vw, 2.5rem); }
.edge-home .page-head { margin-bottom: clamp(1.25rem, 3.2vw, 2.3rem); }
.edge-home h1 { font-size: clamp(2rem, 4.3vw, 3.25rem); line-height: 1.06; font-weight: 650; letter-spacing: -.055em; }
.edge-home .page-head p { font-size: 1rem; margin-top: .6rem; }
.edge-home + .app-footer { margin-top: 1.5rem; }
.edge-directory, .edge-register { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.edge-directory-head, .edge-launch-card { display: grid; grid-template-columns: var(--directory-columns); column-gap: var(--directory-gap); align-items: center; padding-inline: var(--directory-gutter); }
.edge-directory-head { min-height: 2.55rem; background: var(--header); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); font-size: .77rem; font-weight: 600; color: var(--muted); }
.edge-directory-head > :first-child { grid-column: span 2; }
.edge-directory-tasks { display: none; }
.edge-launch-card { position: relative; min-height: 6.7rem; padding-block: 1rem; text-decoration: none; color: var(--ink); }
.edge-launch-card + .edge-launch-card { border-top: 1px solid var(--line); }
.edge-launch-card:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.edge-launch-card:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.edge-launch-card:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--brand-tint) 42%, var(--panel)); }
.edge-launch-card:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -3px; }
.edge-launch-icon { width: 3rem; height: 3rem; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-ink); border-radius: .65rem; }
.edge-launch-icon .icon { width: 1.42rem; height: 1.42rem; }
.edge-launch-title { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.edge-launch-title h2 { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.25rem); letter-spacing: -.025em; font-weight: 650; }
.edge-system { color: var(--dim); }
.edge-launch-copy p { margin: .27rem 0 0; color: var(--muted); font-size: .89rem; }
.edge-workspace-role { font-size: .82rem; font-weight: 550; }
.edge-launch-arrow { display: grid; place-items: center; grid-column: -2; color: var(--muted); width: 2rem; height: 2rem; border-radius: 50%; }
.edge-launch-card:is(:hover, :focus-visible) .edge-launch-arrow { color: var(--brand-ink); background: var(--brand-tint); }
.edge-launch-arrow .icon { width: 1.12rem; }
.edge-tabs { display: flex; align-items: stretch; gap: 1rem; margin-bottom: 1.4rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.edge-tabs a { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .35rem .12rem; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 600; }
.edge-tabs a .icon { width: 1rem; }
.edge-tabs a[aria-current] { color: var(--brand-ink); border-color: var(--vermilion); }
.edge-connector-tabs { margin-top: -.8rem; border: 0; }
.edge-empty { padding: 1.2rem; }
.edge-empty p { margin: .5rem 0 1rem; color: var(--muted); }
.section-stack { grid-template-columns: minmax(0, 1fr); }
.section-stack > *, .view-tools > *, .edge-register { min-width: 0; }
.panel > .edge-register, .panel > .edge-data-table, .edge-register > .edge-data-table { border: 0; border-radius: 0; }
.edge-table-controls, .edge-table-footer { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding: .75rem .9rem; }
.edge-table-controls { border-bottom: 1px solid var(--line); }
.edge-table-controls label { display: grid; gap: .2rem; max-width: 100%; font-weight: 550; }
.edge-table-controls label > span, .edge-table-footer { font-size: .78rem; color: var(--muted); }
.edge-table-controls :is(input, select), .edge-table-footer :is(select, button), .edge-mobile-sort select {
  border: 1px solid var(--input-line); background: var(--panel); color: var(--ink);
  border-radius: .4rem; min-height: 2.5rem; font: inherit; padding: .3rem .55rem;
}
.edge-search { position: relative; display: block; }
.edge-search .icon { position: absolute; left: .67rem; top: 50%; transform: translateY(-50%); width: 1rem; pointer-events: none; }
.edge-table-controls .edge-search input { padding-left: 2.1rem; width: min(16rem,100%); font-size: .87rem; }
.edge-table-footer { align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.edge-table-footer [role=status] { font-family: var(--mono); }
.edge-table-footer button { min-width: 2.5rem; cursor: pointer; margin-inline-start: .28rem; font-size: 1.1rem; }
.edge-table-footer button:disabled { opacity: .46; cursor: default; }
.edge-register .edge-sort { display: inline-flex; align-items: center; gap: .3rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.edge-sort::after { content: "↕"; opacity: .55; }
[aria-sort="ascending"] .edge-sort::after { content: "↑"; opacity: 1; }
[aria-sort="descending"] .edge-sort::after { content: "↓"; opacity: 1; }
.edge-data-table th { color: var(--muted); font-size: .77rem; }
.edge-data-table td { font-variant-numeric: tabular-nums; }
.edge-data-table tbody tr:hover { background: color-mix(in srgb, var(--raised) 40%, var(--panel)); }
.edge-row-filtered { display: none !important; }
.edge-role-fields { margin: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .5rem; }
.edge-role-fields legend { padding-inline: .25rem; }
.edge-secondary-actions { display: flex; align-items: start; flex-wrap: wrap; gap: .4rem; }
.edge-secondary-actions details { display: grid; }
.edge-secondary-actions details .button { display: flex; width: 100%; margin-top: .3rem; }
.edge-secondary-actions summary { display: inline-flex; align-items: center; gap: .3rem; padding-inline: .55rem; min-height: 2.25rem; color: var(--muted); }
.edge-secondary-actions summary .icon { width: .8rem; }
.edge-metrics { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.edge-metrics summary { min-height: 2.75rem; display: flex; align-items: center; padding: .55rem .9rem; font-size: .87rem; font-weight: 650; }
.edge-metrics summary::after { content: "⌄"; margin-left: auto; }
.edge-metrics[open] summary::after { transform: rotate(180deg); }
.edge-metrics .metric-strip { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.metric-strip strong { font-variant-numeric: tabular-nums; }
.page-head { align-items: center; }
.page-head h1 { text-wrap: balance; }
.list-head { min-height: 3.15rem; }
.scan-band { border-left-width: .23rem; }
.scan-band .scan-field input { background: var(--panel); }
.field :is(input, select, textarea):focus-visible, .scan-field input:focus-visible,
.edge-register :is(input, select, button):focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.field :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--red); }
.form-error:not(:empty) { padding: .55rem .7rem; border-left: 2px solid var(--red); background: var(--red-tint); }
.app-footer { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  :root { --directory-columns: 2.65rem minmax(0, 1fr) 1.5rem; --directory-gap: .7rem; --directory-gutter: .9rem; }
  .edge-directory-head > :last-child { display: none; }
  .edge-directory-head { grid-template-columns: 1fr; }
  .edge-directory-head > :first-child { grid-column: auto; }
  .edge-launch-card { row-gap: .25rem; align-items: start; }
  .edge-launch-icon { grid-row: 1 / 3; width: 2.65rem; height: 2.65rem; }
  .edge-launch-arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; width: 1.5rem; }
  .edge-launch-title { gap: .3rem .5rem; }
  .edge-workspace-role { grid-column: 2; font-size: .77rem; color: var(--muted); }
  .edge-workspace-role::before { content: "Access · "; }
  .edge-home .page-head p { font-size: .9rem; }
  .edge-data-table .responsive-table tr:has(td[data-column="Action"]) td:first-child { order: -3; }
  .edge-data-table .responsive-table tr:has(td[data-column="Action"]) td[data-column="Status"] { order: -2; }
  .edge-data-table .responsive-table td[data-column="Action"] { order: -1; grid-column: 1 / -1; }
  .edge-data-table .responsive-table td .button, .edge-table-controls :is(input, select), .edge-table-footer :is(select, button) { min-height: 2.75rem; }
}
@media (max-width: 640px) {
  .page-head { flex-wrap: wrap; row-gap: .6rem; }
  .page-head > * { min-width: 0; max-width: 100%; }
  .edge-topbar-inner { gap: .42rem; }
  .edge-brand span, .edge-account-button .chip-display-name { display: none; }
  .edge-account-button, .edge-switch-button { padding-inline: .42rem; gap: .34rem; }
  .edge-switch-button { font-size: .8rem; }
  .edge-switch-button .icon:first-child { display: none; }
  .edge-nav { gap: .85rem; }
  .edge-nav button { font-size: .8rem; }
  .edge-home { margin-top: .95rem; }
  .edge-launch-copy p { font-size: .83rem; line-height: 1.42; }
  .edge-tools { gap: .12rem; }
  .edge-popover-body { min-width: 12rem; }
  .edge-table-controls, .edge-table-footer { padding: .65rem; }
}
@media (max-width: 365px) { .edge-demo { display: none; } }
@media print {
  .edge-data-table .edge-row-filtered { display: table-row !important; }
  .edge-sort::after { display: none; }
}
@media screen and (max-width: 700px) {
  .wizard-steps { display: flex; align-items: stretch; gap: .3rem; }
  .wizard-step { padding: .4rem; }
  .wizard-step[aria-current] { flex: 1; }
  .wizard-step:not([aria-current]) .step-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
.edge-mobile-sort, .edge-column-name { display: none; }
.edge-table-footer { min-height: 2.5rem; }
@media screen and (max-width: 635px) {
  .edge-mobile-sort { display: inline-flex; align-items: center; gap: .35rem; }
  .edge-mobile-sort select { width: min(9.5rem, 45vw); min-height: 2.75rem; }
  .responsive-table th .edge-sort { display: none; }
  .responsive-table th .edge-column-name { display: inline; }
}
@media screen and (min-width: 636px) {
  .edge-overview [data-column="Order"] .mono, .edge-overview [data-column="Due"] .mono,
  .edge-overview .link-button { white-space: nowrap; }
}
.auth-shell { min-height: calc(100vh - 3.5rem); min-height: calc(100svh - 3.5rem); padding: var(--edge-gutter); }
.auth-grid > * { min-width: 0; }
.auth-grid .auth-form > * { width: 100%; max-width: 34rem; margin-inline: auto; }
.edge-auth-identity { align-content: center; background: var(--graphite); color: var(--ivory); }
.edge-auth-identity > img { margin-bottom: 1.2rem; object-fit: contain; }
.edge-auth-identity h2 { font-size: clamp(2rem, 4vw, 3rem); }
.edge-auth-identity ul { margin-top: 1.65rem; list-style: none; padding: 0; }
.edge-auth-identity li { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding-block: .65rem; border-top: 1px solid #474846; font-size: .9rem; }
.edge-auth-identity li span:last-child { font: 500 .7rem var(--mono); color: #c7c2b8; }
.auth-form .demo-tools .button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-form .demo-tools button { min-height: 2.75rem; white-space: normal; }
@media (max-width: 700px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .edge-auth-identity { display: none; }
}
@media screen and (min-width: 1100px) {
  .edge-home { --directory-columns: 3rem minmax(13rem, 1fr) minmax(18rem, 1.6fr) minmax(10rem, .62fr) 2rem; }
  .edge-directory-tasks { display: inline; }
  .edge-home .edge-launch-copy { display: contents; }
  .edge-home .edge-launch-copy p { margin: 0; }
  .edge-auth-identity > ul { width: 100%; max-width: 42rem; }
  .profile-grid [data-form="profile"] .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wizard-center .wizard-lead { max-width: 72ch; }
  .wizard-center > [data-form="inspection-start"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "type scan" "note scan" "actions actions" "error error";
    align-content: start; align-items: start; gap: .65rem clamp(1.2rem, 3vw, 3rem);
  }
  [data-form="inspection-start"] > .field { grid-area: type; }
  [data-form="inspection-start"] > .fine { grid-area: note; }
  [data-form="inspection-start"] > .big-scan { grid-area: scan; }
  [data-form="inspection-start"] > .button-row { grid-area: actions; }
  [data-form="inspection-start"] > .form-error { grid-area: error; }
  .wizard-products { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .wizard-products > :first-child, .wizard-products > .button-row { grid-column: 1 / -1; }
}
@media screen and (max-width: 700px) and (pointer: coarse) {
  .workspace :is(input, select, textarea), .auth-form :is(input, select, textarea), dialog :is(input, select, textarea) { font-size: 1rem; }
}

@media screen and (min-width: 636px) and (max-width: 1100px) {
  .edge-data-table .edge-action-column,
  .edge-data-table td:is([data-column="Action"], [data-column="Actions"]) {
    position: sticky; right: 0; z-index: 1; background-color: var(--panel); box-shadow: -1px 0 var(--line);
  }
  .edge-data-table .edge-action-column { background-color: var(--header); }
}
