/* Shared light visual system for administration. The entry/sign-in surfaces
   (.login-page, .login-panel, .login-brand, .login-toolbar,
   .login-alternatives, .back-link, .pin-form, .pin-display and the keypad) are
   defined once in styles/entry.css; .entry-page and .entry-card in epos.css. */

/* Administration shell and sidebar. `.admin-shell` is the grid; the sidebar is a
   flex column (brand, grouped navigation, sign out). */
.admin-shell {
    --admin-nav-width: 12rem;
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--admin-nav-width) minmax(0, 1fr);
    overflow: hidden;
    background: var(--epos-surface-sunken);
    color: var(--epos-navy);
}

.admin-sidebar {
    width: var(--admin-nav-width);
    height: 100vh;
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--epos-border-soft);
    background: var(--epos-surface);
    box-shadow: 2px 0 10px rgba(16, 42, 55, .04);
    color: var(--epos-navy);
    padding: .4rem .5rem;
    overflow: hidden;
}

.admin-brand {
    min-height: 60px;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    gap: .6rem;
    border-bottom: 1px solid var(--color-muted);
    padding: .35rem .45rem .65rem;
    color: var(--epos-text);
    font-weight: 800;
    text-align: left;
    text-decoration: none;
}

.admin-brand .brand-mark-small {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
}

.admin-brand-copy {
    min-width: 0;
    display: grid;
    justify-items: start;
}

.admin-brand strong {
    width: 100%;
    max-width: 7.5rem;
    overflow: hidden;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-brand small {
    color: var(--epos-muted);
    font-size: .69rem;
    font-weight: 500;
    line-height: 1.2;
}

.admin-nav {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .25rem;
    margin-top: .2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* A colour as well as the width: Chromium then draws a thin bar with no arrow buttons. */
    scrollbar-color: var(--epos-scrollbar-thumb) transparent;
    scrollbar-width: thin;
}

.admin-nav-group {
    flex: 0 0 auto;
}

.admin-nav-group-label {
    margin: 0;
    padding: .25rem .6rem .15rem;
    color: var(--epos-muted);
    font-size: .68rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.admin-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
    border: 1px solid transparent;
    border-radius: var(--epos-radius-card);
    padding: .45rem .6rem;
    color: var(--epos-ink-muted);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.admin-nav a > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-nav a .epos-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
}

.admin-nav a.active {
    color: var(--epos-primary-strong);
    border-color: var(--epos-border-accent);
    background: var(--epos-cyan-soft);
    box-shadow: inset 3px 0 0 var(--epos-primary);
}

.admin-signout {
    flex: 0 0 auto;
    margin-top: .3rem;
    border-top: 1px solid var(--color-muted);
    padding-top: .3rem;
}

.admin-signout .button-sidebar {
    width: 100%;
    min-height: 44px;
    display: flex;
    justify-content: flex-start;
    gap: .65rem;
    border: 1px solid transparent;
    border-radius: var(--epos-radius-card);
    background: transparent;
    color: var(--epos-ink-muted);
    padding: .45rem .6rem;
    font-size: .86rem;
    font-weight: 500;
    line-height: 1.15;
}

.admin-nav a:hover:not(.active),
.admin-signout .button-sidebar:hover {
    border-color: var(--epos-border);
    background: var(--epos-surface-sunken);
    color: var(--epos-primary-strong);
}

.admin-signout .epos-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.admin-navigation-toggle,
.admin-navigation-backdrop,
.admin-navigation-heading {
    display: none;
}

.admin-navigation-drawer {
    display: contents;
}

.admin-content {
    height: 100vh;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    background: var(--epos-surface-tint);
    font-size: 15px;
    line-height: 1.5;
    scrollbar-color: var(--epos-scrollbar-thumb) var(--epos-surface-sunken);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

/* Every administration page fills the content column inside the shell's padding; no page sets its own cap. */
.admin-page {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0 auto;
}

.admin-page > *,
.admin-page .surface-card {
    min-width: 0;
}

/* Page header, notifications and form rhythm. */
.validation-message {
    color: var(--color-destructive);
}

.admin-notification {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-panel);
    background: var(--epos-surface);
    box-shadow: 0 12px 34px rgba(8, 45, 62, .22);
    padding: 0 0 0 .85rem;
    color: var(--epos-navy);
    font-size: .88rem;
    transition: opacity 180ms var(--epos-ease-out);
    pointer-events: auto;
}

.admin-notification-host {
    position: fixed;
    z-index: 4000;
    top: 1rem;
    right: 1rem;
    width: min(28rem, calc(100vw - 2rem));
    pointer-events: none;
}

.admin-notification-copy {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-notification.success {
    border-color: var(--epos-border-success);
    background: var(--epos-surface-tint);
}

/* Tone of an inline status box (the Clover notice, the database schema result): border, surface and copy in one family. */
.admin-tone-success {
    border-color: var(--epos-border-success);
    background: var(--epos-success-bg);
    color: var(--epos-success-text);
}

.admin-tone-warning {
    border-color: var(--epos-border-warning);
    background: var(--epos-warning-bg);
    color: var(--epos-warning-text);
}

.admin-tone-error {
    border-color: var(--epos-border-danger);
    background: var(--epos-danger-bg);
    color: var(--epos-danger-strong);
}

.admin-notification.error {
    border-color: var(--epos-border-danger);
    background: var(--epos-danger-bg);
}

.admin-notification-icon,
.admin-notification button .epos-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.admin-notification.success .admin-notification-icon {
    color: var(--epos-success);
}

.admin-notification.error .admin-notification-icon {
    color: var(--color-destructive);
}

.admin-notification button {
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
    align-self: stretch;
    border: 0;
    border-left: 1px solid var(--epos-border-soft);
    background: transparent;
    color: var(--epos-ink-slate);
    padding: 0;
}

.admin-notification button:hover {
    background: var(--epos-bg);
    color: var(--epos-navy);
}

@starting-style {
    .admin-notification {
        opacity: 0;
    }
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header p {
    margin-bottom: 0;
    color: var(--epos-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.form-grid .field-wide {
    grid-column: 1 / -1;
}

/* The one button row of a form: primary action on the right, never a border of its own. */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .25rem;
}

/* A secret field (password, PIN, connection password) with its Show / Hide button beside the input. */
.secret-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .45rem;
}

/* A plain row of action buttons (the order detail's print and cancel actions). */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

/* A form footer that pairs a checkbox (Active, Plan Active) with the button row, separated from the fields by a rule. */
.form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    grid-column: 1 / -1;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--epos-border);
}

.form-footer > :is(.checkbox-row, .form-actions) {
    margin: 0;
}

.form-footer > .form-actions {
    margin-left: auto;
}

/* Toolbar: search, filters and actions in one row, fields aligned on their bottom edge. It is either a card of its own
   above a workspace (`.surface-card.admin-toolbar`) or the tinted strip at the top of a flush list card
   (`.admin-toolbar-strip`); a page sets its own grid columns when the fields need fixed proportions. */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .5rem .6rem;
    min-width: 0;
}

.surface-card.admin-toolbar {
    padding: .6rem .7rem;
}

.admin-toolbar-strip {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--epos-border);
    background: var(--epos-surface-tint);
}

.admin-toolbar > .field {
    min-width: 0;
}

.admin-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

/* A view switch inside a page or card toolbar (Print Queue's Pending / History, Payment Review's store): two or three
   pressed toggles in one frame. A page's own sections are AdminTabs; this never stacks a second tab strip under them. */
.admin-segmented {
    display: inline-flex;
    flex: none;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-control);
    background: var(--epos-surface);
    overflow: hidden;
}

.admin-segmented > button {
    min-height: 44px;
    padding: .45rem 1rem;
    border: 0;
    border-right: 1px solid var(--epos-border-soft);
    border-radius: 0;
    background: var(--epos-surface);
    color: var(--epos-ink-soft);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.admin-segmented > button:last-child { border-right: 0; }
.admin-segmented > button:hover:not(.active, :disabled) { background: var(--epos-surface-tint); }
.admin-segmented > button.active { background: var(--epos-cyan-wash); color: var(--epos-primary-strong); }

/* Boxed sub-section inside a card (side-by-side settings groups, editor sections). */
.card-section {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: .7rem;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-card);
    background: var(--epos-surface-tint);
    padding: .8rem;
}

/* Ruled sub-sections stacked inside a long settings card. */
.settings-section-stack {
    display: grid;
    gap: .75rem;
    margin-top: .9rem;
}

.settings-section-card {
    min-width: 0;
    display: grid;
    gap: .75rem;
    border-top: 1px solid var(--epos-border);
    padding-top: .85rem;
}

.settings-section-card:first-child,
.card-heading-row + .settings-section-card {
    border-top: 0;
    padding-top: 0;
}

.split-admin {
    display: grid;
    grid-template-columns: minmax(20rem, 0.8fr) minmax(28rem, 1.4fr);
    gap: 1rem;
    align-items: start;
}

.checkbox-list {
    display: grid;
    gap: 0.45rem;
    max-height: 14rem;
    overflow: auto;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-panel);
    padding: 0.65rem;
}

.checkbox-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 0.55rem;
}

.checkbox-row input {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: var(--epos-primary);
}

.admin-content .checkbox-row > span:has(> small) {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.admin-content .checkbox-row > span > small {
    color: var(--epos-muted);
    font-weight: 400;
    line-height: 1.35;
}

.table-filter {
    width: min(17rem, 100%);
}

.option-group-card {
    display: grid;
    gap: 0.75rem;
}

.admin-content .admin-page > .page-header:first-child {
    width: 100%;
    min-height: 72px;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0;
    padding: .75rem 1rem;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-card);
    background: var(--epos-surface);
    box-shadow: 0 1px 3px rgba(16, 42, 55, .04);
}

.admin-page > .page-header:first-child .eyebrow {
    margin: 0;
    color: var(--epos-primary-strong);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* The one card. A flush card (lists, panels with their own scroller) drops the padding so its heading strip,
   toolbar strip, rows and pagination footer run edge to edge. */
.surface-card {
    border: 1px solid var(--epos-border-soft);
    border-radius: var(--epos-radius-card);
    background: var(--epos-surface);
    box-shadow: var(--epos-shadow-soft);
    padding: .8rem;
}

.surface-card.flush-card {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

/* Metric card (overview and report figures): label, figure, optional note. */
.metric-card {
    min-height: 6.5rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    border-left: 3px solid var(--epos-border-strong);
}

.metric-card strong {
    display: block;
    font-size: 1.55rem;
    font-weight: 650;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.metric-card span {
    color: var(--epos-muted);
    font-weight: 600;
    font-size: .78rem;
}

.metric-card small {
    margin-top: auto;
    color: var(--epos-muted);
    line-height: 1.4;
}

.admin-content .button,
.admin-content input,
.admin-content select,
.admin-content textarea {
    font-size: .86rem;
}

/* Inputs outside a .field (table cells, toolbars) still get the control radius. */
.admin-content input,
.admin-content select,
.admin-content textarea {
    border-radius: var(--epos-radius-control);
}

.admin-content .field input,
.admin-content .field select {
    background: var(--epos-surface-tint);
}

/* Inside a flush card the table runs edge to edge under the heading or filter strip. */
.flush-card > .table-wrap {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.configured-option-groups {
    display: grid;
    max-height: calc(100vh - 10rem);
    grid-template-rows: auto minmax(0, 1fr);
}

.configured-option-group-list {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: .7rem;
    padding: .75rem;
    overflow-y: auto;
}

.configured-option-groups .option-group-card {
    gap: 0;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-card);
    background: var(--epos-surface);
}

.option-group-card-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .7rem;
    background: var(--epos-surface-tint);
}

.option-group-card-identity {
    display: grid;
    min-width: 0;
    gap: .28rem;
}

.option-group-card-title,
.option-group-card-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
}

.option-group-card-title {
    gap: .45rem;
}

.option-group-card-title strong {
    overflow: hidden;
    color: var(--epos-navy);
    font-size: .9rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.option-group-card-meta {
    gap: .35rem .7rem;
    color: var(--epos-muted);
    font-size: .72rem;
}

.option-group-required {
    color: var(--epos-warning-strong);
    font-weight: 650;
}

.option-group-edit {
    min-width: 6.5rem;
    flex: 0 0 auto;
}

.option-group-table-wrap {
    border: 0;
    border-top: 1px solid var(--epos-border-soft);
    border-radius: 0;
}

.option-group-table {
    min-width: 36rem;
    table-layout: fixed;
}

.option-group-table th:nth-child(1) { width: 22%; }
.option-group-table th:nth-child(2) { width: 22%; }
.option-group-table th:nth-child(3) { width: 15%; }
.option-group-table th:nth-child(4) { width: 13%; }
.option-group-table th:nth-child(5) { width: 14%; }
.option-group-table th:nth-child(6) { width: 14%; }
.admin-content .option-group-table th { white-space: normal; overflow-wrap: anywhere; }

.option-name-cell {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* First-level page tabs (AdminTabs): one surface, height and selected state. */
.admin-workspace-navigation {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    min-width: 0;
    margin: 0;
    padding: .375rem;
    border: 1px solid var(--epos-border);
    border-radius: var(--epos-radius-card);
    background: var(--epos-surface);
    overflow: visible;
}

.admin-workspace-navigation > a,
.admin-workspace-navigation > button {
    display: inline-flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 0;
    min-height: 44px;
    padding: .5rem .85rem;
    border: 1px solid transparent;
    border-radius: var(--epos-radius-control);
    background: transparent;
    color: var(--epos-ink-soft);
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

.admin-workspace-navigation .epos-icon { width: 1.05rem; height: 1.05rem; }

/* Scoped to beat `.admin-content small` (0,2,1). */
.admin-content .admin-workspace-navigation > button > small {
    display: inline-grid;
    min-width: 1.55rem;
    min-height: 1.4rem;
    place-items: center;
    border-radius: 999px;
    padding-inline: .35rem;
    background: var(--epos-bg);
    color: var(--epos-ink-deep);
    font-size: .7rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.admin-workspace-navigation > .active {
    border-color: var(--epos-border-accent);
    background: var(--epos-cyan-soft);
    color: var(--epos-primary-strong);
    box-shadow: inset 3px 0 0 var(--epos-primary);
}

.admin-content .admin-workspace-navigation > .active > small {
    background: var(--epos-surface);
    color: var(--epos-primary-strong);
}

.admin-workspace-navigation > a:hover:not(.active),
.admin-workspace-navigation > button:hover:not(.active) {
    background: var(--epos-cyan-wash);
    border-color: var(--epos-border-accent);
    color: var(--epos-primary-strong);
}

.admin-content .alert {
    border-radius: var(--epos-radius-control);
}

@media (max-width: 900px) {
    .admin-shell {
        --admin-nav-width: 6rem;
        height: 100vh;
        min-height: 0;
        grid-template-columns: var(--admin-nav-width) minmax(0, 1fr);
        overflow: hidden;
    }

    .admin-sidebar {
        width: var(--admin-nav-width);
        height: 100vh;
        min-height: 0;
        position: sticky;
        overflow: hidden;
    }

    .admin-content {
        height: 100vh;
        overflow-y: auto;
    }

    .split-admin,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-signout {
        margin-top: 1rem;
    }
}

/* Feature-page scale: grid rhythm, field and table density inside the content frame. */
.admin-content .admin-page {
    display: grid;
    align-content: start;
    gap: .75rem;
}

.admin-content .field {
    gap: .25rem;
}

.admin-content .admin-page:not(.print-design-page) .field {
    min-width: 0;
    gap: .35rem;
}

.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]), select) {
    min-width: 0;
    max-width: 100%;
    height: 44px;
    font-size: .86rem;
}

.admin-content .admin-page:not(.print-design-page) .form-grid {
    align-items: start;
    gap: .75rem;
}

.admin-content .admin-page .form-grid > .button {
    align-self: end;
}

.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) :is(.input-prefix, .input-suffix) {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) :is(.input-prefix, .input-suffix) > input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}

.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) :is(.input-prefix, .input-suffix) > span {
    display: grid;
    place-items: center;
    flex: none;
    min-width: 2.5rem;
    padding: .5rem .65rem;
    border: 1px solid var(--epos-border);
    background: var(--epos-surface-sunken);
    color: var(--epos-ink-slate);
    font-size: .8rem;
    font-weight: 600;
}

.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .input-prefix > input { border-radius: 0 var(--epos-radius-control) var(--epos-radius-control) 0; }
.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .input-prefix > span { border-radius: var(--epos-radius-control) 0 0 var(--epos-radius-control); border-right: 0; }
.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .input-suffix > input { border-radius: var(--epos-radius-control) 0 0 var(--epos-radius-control); }
.admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .input-suffix > span { border-radius: 0 var(--epos-radius-control) var(--epos-radius-control) 0; border-left: 0; }

.admin-content .admin-page:not(.print-design-page) .form-grid > .checkbox-row {
    min-height: 44px;
    align-self: end;
    margin: 0;
}

.admin-content .table-action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.admin-content .admin-page :is(.split-admin, .form-grid) > * {
    min-width: 0;
}

.admin-content .admin-page > :is(.surface-card, .split-admin, .report-metric-grid, .report-table-grid) {
    margin-block: 0;
}

/* A group of choices laid out as one field: the legend is its label. */
.admin-content fieldset {
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0;
}

.admin-content .field label,
.admin-content legend {
    color: var(--epos-ink-deep);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.3;
}

.admin-content small {
    color: var(--epos-muted);
    font-size: .76rem;
    line-height: 1.4;
}

/* A list row's text: a name over a small description, each kept to one line. A page sheet may restyle a child
   (the print designer clamps the name to two lines). */
.list-row-text {
    display: grid;
    min-width: 0;
    gap: .1rem;
}

.list-row-text > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

.page-header-actions .status-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 40px;
    padding-inline: .65rem;
}

.page-header-actions .status-pill .epos-icon {
    width: 1rem;
    height: 1rem;
}

/* Shared compact administration shell for the supported 1024 x 768 PC layout. */
@media (min-width: 761px) and (max-width: 1024px) {
    .admin-shell {
        --admin-nav-width: 10.25rem;
    }

    .admin-shell .admin-sidebar {
        padding-inline: .4rem;
    }

    .admin-shell .admin-brand {
        min-height: 54px;
        padding-bottom: .45rem;
    }

    .admin-shell .admin-nav {
        gap: .12rem;
    }

    .admin-shell .admin-nav-group-label {
        padding-block: .18rem .08rem;
    }

    .admin-shell .admin-nav a,
    .admin-shell .admin-signout .button-sidebar {
        min-height: 44px;
        padding-block: .35rem;
        font-size: .78rem;
    }

    .admin-shell .admin-content {
        padding: .65rem .75rem 1rem;
    }

    .admin-shell .admin-page {
        gap: .6rem;
    }

    .admin-shell .admin-page > .admin-page-header:first-child {
        min-height: 64px;
        padding: .55rem .7rem;
    }

    .admin-shell .admin-page-header .page-header-actions {
        gap: .35rem;
    }

    .admin-shell .admin-workspace-navigation {
        gap: .3rem;
        padding: .35rem;
    }

    .admin-shell .admin-workspace-navigation > :is(a, button) {
        min-height: 44px;
        padding-inline: .55rem;
        font-size: .78rem;
    }
}

@media (max-width: 760px) {
    body:has(.admin-shell) { overflow: hidden; }

    .admin-content {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        padding: .6rem .6rem max(.6rem, calc(.6rem + env(safe-area-inset-bottom)));
        scrollbar-gutter: auto;
        overflow-x: hidden;
    }

    .admin-content .admin-page { min-height: 0; }

    .admin-content .admin-page > .page-header:first-child {
        flex-wrap: wrap;
        padding: .75rem;
    }

    .admin-content .admin-page-header .page-header-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .admin-content .surface-card { padding: .75rem; }

    /* Scoped past the (0,2,0) Dashboard, Printing and Restaurant component styles that load later. */
    .admin-shell .admin-content :is(.form-grid, .split-admin,
        .overview-sales-layout, .printing-layout, .terminal-card-grid,
        .database-settings-layout, .database-transfer-grid, .brand-settings-layout,
        .integration-settings-grid, .transaction-reason-grid, .print-designer-layout,
        .platform-mapping-toolbar, .restaurant-definition-layout) {
        grid-template-columns: minmax(0, 1fr);
    }
    .admin-shell .admin-content :is(.overview-metrics, .report-metric-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-content :is(.form-grid, .database-settings-layout, .print-designer-layout) > * { min-width: 0; }
    .admin-content .form-grid > .field-wide { grid-column: 1 / -1; }
    .admin-content .field { min-width: 0; }
    .admin-content :is(input, select, textarea) { max-width: 100%; }
    .admin-shell .admin-content :is(input, select, textarea) { font-size: 16px; }
    .admin-shell .admin-content :is(.admin-page:not(.print-design-page), .catalogue-editor-panel) .field :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]), select) { font-size: 16px; }
    .admin-content .table-wrap { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
    .admin-content :is(.card-heading-row, .queue-toolbar, .receipt-printer-picker,
        .emergency-terminal-picker, .catalogue-pagination, .form-actions) { flex-wrap: wrap; gap: .5rem; }
    .admin-content .form-actions > .button { flex: 1 1 9rem; }
    .admin-content :is(.receipt-printer-picker, .emergency-terminal-picker) select { flex-basis: 100%; }
    .admin-content .overview-metrics strong { font-size: 1.5rem; overflow-wrap: anywhere; }
    .admin-content .integration-host-card dl { overflow-wrap: anywhere; }
    .admin-content .modal-overlay { padding: .5rem; }
    .admin-content .pos-modal { max-width: 100%; max-height: calc(100dvh - 1rem); overflow-y: auto; }
    .admin-content :is(.modal-header, .modal-actions) { flex-wrap: wrap; gap: .5rem; }
    .admin-content .split-admin { grid-template-columns: minmax(0, 1fr); }

    /* On a phone the list keeps its own scroll area (on a PC it follows the page), otherwise a long result list pushes
       the selected order below the visible page. The page itself grows inside the shell's main scroller. */
    .admin-orders-page :is(.admin-order-list-panel, .online-order-list-panel) { max-height: min(28rem, 48dvh); }
    .admin-orders-page :is(.order-result-list, .online-order-list) { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* Page header and heading scale, surface cards, tables and card headings. */

.admin-page > .page-header:first-child, .card-heading-row {
    color: var(--epos-text);
}

.admin-page > .page-header:first-child > div:first-child, .card-heading-row > div:first-child {
    display: grid;
    min-width: 0;
    gap: .14rem;
}

.admin-page > .page-header:first-child h1 {
    margin: 0;
    color: var(--epos-text);
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}

.admin-page > .page-header:first-child p:not(.eyebrow), .card-heading-row p {
    margin: 0;
    color: var(--epos-muted);
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.4;
}

.admin-content .surface-card h2, .admin-content .surface-card .page-header h2 {
    margin: 0 0 .7rem;
    color: var(--epos-text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.005em;
}

.admin-content .surface-card .page-header h2, .admin-content .surface-card header h2 {
    margin-bottom: 0;
}

/* Card heading (AdminCardHeader): one row for every card, panel and settings section. The h2/h3 reset must beat
   `.admin-content .surface-card h2`. */
.admin-content .card-heading-row {
    display: flex;
    min-height: 44px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--epos-border);
}

.admin-content .surface-card .card-heading-row :is(h2, h3) {
    margin: 0;
    padding: 0;
    border: 0;
}

.card-heading-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}

.card-heading-count {
    display: inline-grid;
    min-width: 2.2rem;
    min-height: 1.75rem;
    place-items: center;
    border-radius: var(--epos-radius-control);
    padding-inline: .45rem;
    background: var(--epos-bg);
    color: var(--epos-payment-card-hover);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}

.card-heading-actions {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    gap: .5rem;
}

/* A flush card keeps a tinted heading strip; the order list stays white over its tinted body. */
.admin-content .flush-card > .card-heading-row {
    margin-bottom: 0;
    padding: .7rem .85rem;
    background: var(--epos-surface-tint);
}

.admin-content .admin-order-list-panel > .card-heading-row {
    background: var(--epos-surface);
}

/* Ruled settings sections separate themselves with a border-top, so their heading carries none. */
.admin-content .settings-section-card > .card-heading-row {
    min-height: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

/* A boxed section's heading is compact with a soft rule. */
.admin-content .card-section > .card-heading-row {
    min-height: 0;
    margin-bottom: 0;
    padding-bottom: .45rem;
    border-bottom: 1px solid var(--epos-border-soft);
}

.split-admin > div > .surface-card + .surface-card {
    margin-top: 1rem;
}

.admin-content .surface-card h3 {
    color: var(--epos-text);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 650;
    line-height: 1.25;
}

.admin-content .surface-card h4 {
    color: var(--epos-text);
    font-family: inherit;
    font-size: .86rem;
    font-weight: 650;
    line-height: 1.25;
}

/* The one empty state (also AdminLoading's inline row): centred copy, optional strong lead and a follow-up button. */
.admin-content .empty-state {
    display: grid;
    min-height: 8rem;
    place-content: center;
    gap: .4rem;
    padding: 1.5rem 1rem;
    color: var(--epos-muted);
    text-align: center;
}

.admin-content .empty-state strong {
    color: var(--epos-navy);
    font-size: .95rem;
}

.admin-content .empty-state .button {
    justify-self: center;
    margin-top: .4rem;
}

/* A detail panel's placeholder fills the panel beside the list. */
.admin-content .admin-order-detail-empty {
    min-height: 16rem;
}

.admin-content .table-actions .table-action-buttons {
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .admin-shell { display: flex; flex-direction: column; height: 100dvh; }
    .admin-sidebar { position: relative; width: 100%; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: max(.25rem, env(safe-area-inset-top)) max(.6rem, env(safe-area-inset-right)) .25rem max(.6rem, env(safe-area-inset-left)); flex: 0 0 auto; border-bottom: 1px solid var(--epos-border); }
    .admin-brand { border: 0; min-height: 56px; padding-bottom: .35rem; }
    .admin-brand strong { max-width: none; }
    .admin-navigation-toggle { display: flex; align-self: center; gap: .4rem; min-height: 44px; }
    .admin-navigation-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 100;
        border: 0;
        border-radius: 0;
        background: rgb(16 42 55 / 40%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 180ms var(--epos-ease-out), visibility 180ms;
    }
    .admin-navigation-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 101;
        display: flex;
        flex-direction: column;
        width: min(20rem, 86vw);
        height: 100dvh;
        padding: .6rem;
        padding-top: max(.6rem, env(safe-area-inset-top));
        padding-right: max(.6rem, env(safe-area-inset-right));
        padding-bottom: max(.6rem, env(safe-area-inset-bottom));
        background: var(--epos-surface);
        box-shadow: -6px 0 24px rgb(16 42 55 / 16%);
        visibility: hidden;
        transform: translateX(100%);
        transition: transform 180ms var(--epos-ease-out), visibility 180ms;
    }
    .admin-navigation-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        padding: .25rem .4rem .6rem;
        border-bottom: 1px solid var(--epos-border);
    }
    .admin-navigation-heading .button { width: 44px; padding: .5rem; }
    .navigation-expanded .admin-navigation-backdrop { opacity: 1; visibility: visible; }
    .navigation-expanded .admin-navigation-drawer { transform: translateX(0); visibility: visible; }
    .admin-workspace-navigation { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
    .admin-workspace-navigation > :is(a, button) { flex: 0 0 auto; padding-inline: .65rem; white-space: nowrap; }
}

/* A short list of labelled values: the label column as wide as its longest label. */
.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .5rem 1.2rem;
    margin: 0;
}

.detail-list dt {
    color: var(--epos-muted);
    font-weight: 600;
}

.detail-list dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

/* Codes read and compared character by character: machine fingerprints, licence and pairing codes, coupon codes. */
.code-text {
    font-family: Consolas, "Cascadia Mono", monospace;
    letter-spacing: .04em;
}

/* The friendly error page over the whole shell when the circuit fails, as on the till. */
#blazor-error-ui {
    color-scheme: light only;
    box-sizing: border-box;
    display: none;
    position: fixed;
    inset: 0;
    overflow: auto;
    z-index: 10000;
}
