/* Shop design system: shared foundations, layout, controls and surfaces. */
:root {
    --navy-950: #050b14; --navy-900: #0a1626; --navy-800: #0f223d;
    --navy-700: #1a365d; --navy-600: #2a4365; --navy-500: #2c5282;
    --navy-400: #4299e1; --navy-100: #ebf8ff; --navy-050: #f7fafc;
    --color-bg: #f3f5f8; --color-surface: #fff; --color-border: #d8e0e9;
    --color-text-primary: #1a202c; --color-text-secondary: #475569; --color-text-muted: #586779;
    --color-primary: var(--navy-800); --color-primary-hover: var(--navy-700); --color-accent: var(--navy-400);
    --surface: #fff; --surface-muted: #f5f7fa; --rule: #e1e7ee; --rule-strong: #c3ceda;
    --sidebar-width: 248px; --header-height: 64px; --bottom-nav-height: 64px;
    --pane-pad: 1.5rem; --radius-control: 6px; --border-radius: 10px; --border-radius-sm: 6px;
    --bs-primary: #0f223d; --bs-link-color: #234f7e; --bs-link-hover-color: #0f223d;
}
html { scroll-padding-top: 5rem; scroll-padding-bottom: 8rem; }
html, body { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5; background: var(--color-bg); color: var(--color-text-primary); margin: 0; min-height: 100%; }
*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, h5, h6 { color: var(--navy-900); font-weight: 600; overflow-wrap: anywhere; }
p, dd, .row-main, .row-sub, .fact-value, .owner-shop-card, .store-content { overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2276b9 !important; outline-offset: 3px; }
[id] { scroll-margin-top: 5rem; }
.text-primary { color: var(--navy-700) !important; }
.bg-primary { background: var(--navy-800) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.small, small { font-size: .875rem; }
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: 1200; padding: .8rem 1rem; background: white; color: var(--navy-900); border-radius: var(--radius-control); }
.skip-link:focus { top: 1rem; }

/* Document scrolling keeps content reachable below navigation and the keyboard. */
.layout-wrapper { display: flex; min-height: 100dvh; width: 100%; }
.sidebar-wrapper { width: var(--sidebar-width); position: sticky; top: 0; height: 100dvh; flex-shrink: 0; background: var(--navy-900); color: #fff; display: flex; flex-direction: column; z-index: 1040; }
.main-content-wrapper { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; background: var(--color-bg); }
body .content-container { padding: 1.5rem; width: 100%; max-width: 1440px; margin: 0 auto; }
.page-head, body .page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem 0 1.25rem; margin: 0; }
.page-head > div, .page-header > div { min-width: 0; }
.page-head h1, .page-head h2, body .page-header h1, body .page-header h2, body .page-header h4 { margin: 0; font-size: clamp(1.3rem, 2vw, 1.65rem); font-weight: 650; line-height: 1.25; }
.page-head-sub, .page-subtitle, .page-header p { font-size: .875rem; color: var(--color-text-muted); margin: .35rem 0 0; }
.page-header-actions, .header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; min-width: 0; }
.page-head-id { font: .8em ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--color-text-secondary); }

/* Consistent controls and readable labels across intake, records and settings. */
body .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 44px; min-height: 44px; border-radius: var(--radius-control); padding: .6rem .9rem; font-size: .9rem; font-weight: 600; line-height: 1.35; white-space: normal; }
body .btn-sm { min-height: 44px; padding: .45rem .7rem; font-size: .875rem; }
body .btn > i, body .btn > .spinner-border { margin-inline: 0 !important; }
body .btn-link { color: #234f7e; text-decoration: underline; text-underline-offset: .15em; }
body .btn-link.p-0 { padding: .4rem .5rem !important; }
.btn-primary { --bs-btn-bg: #0f223d; --bs-btn-border-color: #0f223d; --bs-btn-hover-bg: #1a365d; --bs-btn-hover-border-color: #1a365d; --bs-btn-active-bg: #1a365d; --bs-btn-active-border-color: #1a365d; --bs-btn-disabled-bg: #0f223d; --bs-btn-disabled-border-color: #0f223d; }
.btn-outline-primary { --bs-btn-color: #1a365d; --bs-btn-border-color: #1a365d; --bs-btn-hover-bg: #1a365d; --bs-btn-hover-border-color: #1a365d; --bs-btn-active-bg: #1a365d; --bs-btn-active-border-color: #1a365d; }
.btn-outline-secondary { --bs-btn-color: #475569; --bs-btn-border-color: #bdc9d6; --bs-btn-hover-color: #0f223d; --bs-btn-hover-bg: #edf2f7; --bs-btn-hover-border-color: #94a3b8; }
body .form-control, body .form-select { min-height: 44px; font-size: 1rem; padding: .6rem .75rem; border: 1px solid #b9c5d3; border-radius: var(--radius-control); color: var(--color-text-primary); }
body .customer-search .form-control, body .customer-search .form-select { font-size: 1rem; }
body .form-control:focus, body .form-select:focus { border-color: #2276b9; box-shadow: 0 0 0 3px rgba(34,118,185,.15); }
body .form-label { color: var(--color-text-secondary); font-size: .9rem; font-weight: 600; text-transform: none !important; letter-spacing: normal; margin-bottom: .4rem; }
body .form-label.required::after { content: ' *'; color: #b42318; }
body .form-check { min-height: 44px; padding-top: .5rem; padding-bottom: .5rem; }
body .form-check-input { width: 1.15em; height: 1.15em; border-color: #8293a5; }
body .form-check-label { font-size: .9rem; cursor: pointer; }
body .input-group-text { border-color: #b9c5d3; background: var(--surface-muted); border-radius: var(--radius-control); }
body .invalid, body [aria-invalid='true'] { border-color: #b42318; }
.validation-message, .validation-errors { color: #b42318; font-size: .875rem; }
.validation-message { margin-top: .35rem; }
.validation-errors:empty { display: none; }
body .btn-close { flex: 0 0 auto; width: 1rem; height: 1rem; min-width: 44px; min-height: 44px; padding: .65rem; background-size: 1rem; box-sizing: border-box; opacity: .7; }
body .alert-dismissible { padding-right: 3.5rem; }
body .icon-action-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-control); border: 1px solid var(--rule); background: white; color: var(--color-text-secondary); display: inline-flex; align-items: center; justify-content: center; }
body .icon-action-btn:hover { background: var(--surface-muted); color: var(--navy-800); }
body .icon-action-btn.action-delete:hover { color: #b42318; border-color: #b42318; }
body .btn i, .icon-action-btn i { width: 1em; flex-shrink: 0; text-align: center; }

/* Surfaces group related information without adding decorative noise. */
body .card, body .section-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--border-radius); box-shadow: none; margin-bottom: 1.25rem; min-width: 0; overflow: visible; }
body .card:hover, body .section-card:hover { box-shadow: none; }
body .section-card-header, body .card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem; padding: 1.1rem var(--pane-pad); background: transparent; border-bottom: 1px solid var(--rule); border-radius: var(--border-radius) var(--border-radius) 0 0; }
body .section-card-header h5, body .section-card-header h6, body .card-header h5, body .card-header h6 { font-size: 1rem; margin: 0; font-weight: 600; color: var(--navy-900); letter-spacing: normal; text-transform: none; }
body .section-card-body, body .card-body { padding: var(--pane-pad); }
body .section-card-footer, body .card-footer { padding: 1rem var(--pane-pad); border-top: 1px solid var(--rule); background: transparent; }
body .shadow, body .shadow-sm, body .shadow-lg { box-shadow: none !important; }
body .table { margin-bottom: 0; }
body .table th { background: var(--surface-muted); border-bottom: 1px solid var(--rule-strong); padding: .85rem 1rem; font-size: .82rem; color: var(--color-text-secondary); text-transform: none; letter-spacing: normal; font-weight: 600; }
body .table td { padding: .9rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; color: var(--color-text-primary); }
.table-responsive, .desktop-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
body .badge, .tag-pill { display: inline-flex; align-items: center; gap: .25rem; white-space: normal; line-height: 1.4; font-weight: 500; font-size: .78rem; border-radius: 5px; padding: .25rem .5rem; letter-spacing: normal; }
.tag-gray { background: #edf2f7; color: #475569; } .tag-blue { background: #edf5fc; color: #234f7e; } .tag-green { background: #edf8f1; color: #276749; } .tag-red { background: #fef1f0; color: #b42318; } .tag-yellow { background: #fffaeb; color: #854d0e; } .tag-mono { background: var(--surface-muted); color: var(--color-text-secondary); font-family: ui-monospace, monospace; }
.value-highlight { color: var(--navy-800); font-weight: 600; }
body .alert { padding: 1rem; border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); border-radius: var(--radius-control); background: var(--surface-muted); font-size: .9rem; color: var(--color-text-secondary); }
body .alert-info, body .alert-primary { border-left-color: #2276b9; }
body .alert-warning { border-left-color: #b7791f; background: #fffbf0; color: #754c12; }
body .alert-danger { border-left-color: #b42318; background: #fff6f5; color: #a11c14; }
body .alert-success { border-left-color: #2b7b4b; background: #f2faf4; color: #276749; }
.empty-state-global { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1rem; }
.empty-icon, .summary-icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-muted); color: var(--navy-700); border-radius: 8px; margin-bottom: .75rem; }
.empty-state-global p { color: var(--color-text-muted); max-width: 36rem; }
.summary-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--pane-pad); border-top: 1px solid var(--rule); }
.pagination-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; }
.pagination-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; min-width: 0; }
.pagination-footer > nav { min-width: 0; max-width: 100%; }
body .pagination-navy { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 100%; }
body .pagination-navy .page-link { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin: 0; border-radius: var(--radius-control); color: var(--color-text-secondary); }
.pagination-navy .page-item.active .page-link { background: var(--navy-800); border-color: var(--navy-800); color: white; }

/* All dialogs share one scrolling model, including forms and nested ID scans. */
body .modal.show { overflow-x: hidden; overflow-y: auto; padding: 1rem; height: 100dvh; overscroll-behavior: contain; }
body .modal-dialog { margin: auto; min-height: calc(100dvh - 2rem); width: 100%; }
body .modal-content { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); min-height: 0; border: 1px solid var(--rule); border-radius: var(--border-radius); box-shadow: 0 18px 65px rgba(10,22,38,.24); background: white; overflow: hidden; }
body .modal-dialog-scrollable { height: calc(100dvh - 2rem); min-height: 0; }
body .modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
body .modal-header, body .modal-footer { flex: 0 0 auto; padding: 1rem var(--pane-pad); gap: .6rem; border-color: var(--rule); background: white; }
body .modal-body, body .invite-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--pane-pad); scroll-padding: 1rem; }
body .modal-title { font-size: 1.15rem; line-height: 1.35; }
body .modal-footer { flex-wrap: wrap; }
body .modal-footer > .btn { margin: 0; }
body .modal .modal { z-index: 1080; }
body .dropdown-menu { max-width: calc(100vw - 2rem); border: 1px solid var(--rule-strong); border-radius: var(--radius-control); box-shadow: 0 10px 24px rgba(15,34,61,.12); }
body .dropdown-item { min-height: 44px; display: flex; align-items: center; white-space: normal; }
body.ncpd-overlay-open { overflow: hidden; }
.modal[data-focus-origin="pointer"]:focus, #shop-navigation[data-focus-origin="pointer"]:focus { outline: none !important; }

/* Navigation and viewport reservations. */
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); background: white; border-top: 1px solid var(--rule-strong); z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-link { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; border: 0; background: transparent; font-size: .78rem; font-weight: 600; color: var(--color-text-secondary); text-decoration: none; min-height: 44px; }
.bottom-nav-link i { font-size: 1.15rem; }
.bottom-nav-link.active { background: #edf3fa; color: var(--navy-800); }
@media (max-width: 991.98px) {
    :root { --pane-pad: 1.1rem; }
    .sidebar-wrapper { position: fixed; inset: 0 auto 0 0; height: 100dvh; max-width: calc(100vw - 3rem); transform: translateX(-100%); visibility: hidden; transition: transform .2s; }
    .sidebar-wrapper.show { transform: translateX(0); visibility: visible; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,22,38,.5); z-index: 1035; }
    .bottom-nav { display: flex; }
    body .content-container { padding: 1.1rem 1rem calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 1.5rem); }
    body:has(.workflow-page) .bottom-nav { display: none; }
    body:has(.workflow-page) .content-container { padding-bottom: 1rem; }
}
@media (max-width: 575.98px) {
    body .content-container { padding-left: .75rem; padding-right: .75rem; }
    .page-head, body .page-header { align-items: flex-start; gap: .75rem; }
    .page-header-actions { width: 100%; }
    .page-header-actions .btn-primary { flex: 1; }
    body .btn-sm, body .chip { min-height: 44px; }
    body .modal.show { padding: .5rem; }
    body .modal-dialog { min-height: calc(100dvh - 1rem); }
    body .modal-content { max-height: calc(100dvh - 1rem); }
    body .modal-header, body .modal-footer { padding: .8rem 1rem; }
    body .modal-footer .btn { flex: 1 1 auto; }
    .pane-row > .pane + .pane { border-left: 0; border-top: 1px solid var(--rule); }
    .row-item { flex-wrap: wrap; }
    .row-end { margin-left: auto; }
    .receipt { padding: 1rem; } .receipt-title-block { text-align: left; }
    .receipt-number { font-size: 1.25rem; overflow-wrap: anywhere; }
    .receipt-table { display: block; overflow-x: auto; }
    .owner-shop-card__head, .owner-shop-card__foot { flex-wrap: wrap; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; } }
/* -- Panes ------------------------------------------------------------- */
.pane {
    padding: var(--pane-pad);
    min-width: 0;
}

.pane + .pane {
    border-top: 1px solid var(--rule);
}

.pane-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.pane-row + .pane,
.pane + .pane-row,
.pane-row + .pane-row {
    border-top: 1px solid var(--rule);
}

.pane-row > .pane + .pane {
    border-top: 0;
    border-left: 1px solid var(--rule);
}

.pane--muted {
    background: var(--surface-muted);
}

.eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.eyebrow .count {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* -- Facts (label over value) ------------------------------------------ */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: 0.9rem 1.25rem;
}

.facts--wide {
    grid-template-columns: 1fr;
}

.fact-label {
    display: block;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0 0 0.1rem;
}

.fact-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0;
    overflow-wrap: anywhere;
}

.fact-value.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
}

.fact-value.muted {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* -- Ruled rows (lists) ------------------------------------------------ */
.rows {
    display: flex;
    flex-direction: column;
}

.row-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--rule);
    min-width: 0;
}

.row-item:first-child {
    border-top: 0;
}

.row-item .row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.row-item .row-title {
    font-weight: 600;
    color: var(--color-text-primary);
}

.row-item .row-sub {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.row-item .row-end {
    text-align: right;
    white-space: nowrap;
}

.row-item.is-clickable {
    cursor: pointer;
}

.row-item.is-clickable:hover {
    background: var(--surface-muted);
}

/* -- Media rail --------------------------------------------------------- */
.rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--rule);
    background: var(--surface-muted);
}

.thumb--lg {
    width: 120px;
    height: 120px;
}

.thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    color: var(--color-text-muted);
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
}

/* -- Pills, notes, help ------------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 3px;
    background: var(--surface-muted);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.pill--ok { background: #e6f4ea; color: #276749; }
.pill--warn { background: #fdf3dc; color: #975a16; }
.pill--bad { background: #fde8e8; color: #c53030; }
.pill--info { background: #e8f2fc; color: #2b6cb0; }
.pill--navy { background: var(--navy-800); color: #fff; }

.note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding: 0.5rem 0;
}

.note--warn { color: #975a16; }
.note--bad { color: #c53030; }
.note--ok { color: #276749; }

.note i {
    margin-top: 0.15rem;
}

.tip {
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.tip > summary {
    list-style: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--rule-strong);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tip > summary::-webkit-details-marker {
    display: none;
}

.tip[open] > summary {
    background: var(--navy-800);
    border-color: var(--navy-800);
    color: #fff;
}

.tip-body {
    position: static;
    z-index: 1040;
    top: calc(100% + 6px);
    left: 0;
    min-width: 0;
    max-width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    box-shadow: 0 10px 30px rgba(15, 34, 61, 0.18);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
}

.tip--right .tip-body {
    left: auto;
    right: 0;
}


/* ---------- Submission receipt ---------- */
.receipt {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  color: #1a202c;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2rem 2.25rem;
  box-shadow: 0 2px 12px rgba(15, 34, 61, 0.08);
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #0f223d;
}

.receipt-shop-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f223d;
}

.receipt-shop-meta {
  font-size: 0.85rem;
  color: #4a5568;
}

.receipt-title-block {
  text-align: right;
}

.receipt-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.receipt-number {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  color: #0f223d;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1rem 1.5rem;
  font-size: 0.92rem;
}

.receipt-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

.receipt-muted {
  font-size: 0.82rem;
  color: #4a5568;
}

.receipt-mono {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 0.88rem;
}

.receipt-section {
  margin-top: 1.5rem;
}

.receipt-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0f223d;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.receipt-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.receipt-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}

.receipt-table tfoot td {
  border-bottom: 0;
  padding-top: 0.75rem;
}

.receipt-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
}

.receipt-signature-line {
  border-bottom: 1px solid #1a202c;
  height: 2.2rem;
  margin-bottom: 0.35rem;
}

.receipt-footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

@media print {
  .sidebar-wrapper,
  .mobile-topbar,
  .sidebar-backdrop,
  .receipt-toolbar {
    display: none !important;
  }

  .main-content-wrapper,
  .content-container {
    margin: 0 !important;
    padding: 0 !important;
  }

  .receipt-page {
    padding: 0 !important;
    max-width: none !important;
  }

  .receipt {
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
  }

  body {
    background: #fff !important;
  }
}

/* ---------- Owner overview ---------- */
.owner-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  padding: 1.25rem;
}

.owner-shop-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.owner-shop-card--current {
  border-color: #0f223d;
  box-shadow: 0 0 0 2px rgba(15, 34, 61, 0.08);
}

.owner-shop-card--quiet {
  border-color: #f6ad55;
  background: #fffaf0;
}

.owner-shop-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.owner-shop-card__name {
  font-weight: 700;
  color: #0f223d;
}

.owner-shop-card__address {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.owner-shop-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.owner-shop-stat {
  background: #f7fafc;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
}

.owner-shop-stat__value {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a202c;
}

.owner-shop-stat__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.owner-shop-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #4a5568;
}

.owner-overview-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: #4a5568;
}

.owner-overview-totals strong {
  color: #0f223d;
}


/* Intake and record components use the same spacing and surfaces as the shell. */
.workflow-page, .detail-page { background: white; border: 1px solid var(--rule); border-radius: var(--border-radius); }
.workflow-page > .page-head, .detail-page > .page-head { padding: 1.25rem var(--pane-pad); border-bottom: 1px solid var(--rule); }
.workflow-page { max-width: 1200px; margin: 0 auto; }
.pane--flush { padding: 0; }
.review-total { background: var(--surface-muted); padding-left: 1rem; padding-right: 1rem; }
.eyebrow { font-size: .85rem; text-transform: none; letter-spacing: normal; color: var(--navy-700); }
.eyebrow-actions { display: inline-flex; align-items: center; gap: .4rem; }
body .workflow-container.has-sticky-actions { padding-bottom: var(--workflow-actions-height, 8rem); }
body .workflow-action-bar { position: fixed; bottom: 0; left: calc(var(--sidebar-width) + max(1.5rem, (100vw - var(--sidebar-width) - 1200px) / 2)); right: max(1.5rem, (100vw - var(--sidebar-width) - 1200px) / 2); z-index: 1025; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; border: 1px solid var(--rule-strong); border-bottom: 0; background: white; padding: .8rem var(--pane-pad) calc(.8rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(10,22,38,.04); }
body .workflow-action-bar .context-content { display: flex; flex: 1 1 180px; min-width: 0; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .875rem; overflow-wrap: anywhere; }
body .workflow-action-bar .action-buttons { display: flex !important; flex-wrap: wrap; align-items: stretch; justify-content: flex-end; gap: .6rem; min-width: 0; }
body .workflow-action-bar .action-buttons .btn { min-height: 48px; min-width: 0; text-align: center; }
body .workflow-action-bar--inline { position: static; box-shadow: none; border-inline: 0; }
.workflow-action-bar .context-content .ms-2 { margin-left: 0 !important; }
.workflow-page .btn > i, .workflow-page .btn > .spinner-border, .submit-confirmation-modal .btn > i, .submit-confirmation-modal .btn > .spinner-border { margin-inline: 0 !important; }
.workflow-page .eyebrow { flex-wrap: wrap; gap: .5rem; }
.workflow-page .eyebrow-actions { flex-wrap: wrap; }
.workflow-page .note { min-width: 0; flex-wrap: wrap; }
.workflow-page .note > span:not(.spinner-border) { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.workflow-page .fact-value, .workflow-page .row-main, .workflow-page .row-end { min-width: 0; }
.workflow-page input, .workflow-page select, .workflow-page textarea { scroll-margin-bottom: calc(var(--workflow-actions-height, 8rem) + 1rem); }
.review-photo-status { display: flex; flex-wrap: wrap; gap: .4rem; }
.transaction-review .facts > div:has(.review-photo-status) { grid-column: 1 / -1; }
.review-photo-status .pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.review-field-label { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; margin-bottom: .4rem; }
.review-field-label .form-label { margin: 0; }
.review-field-error { color: #b42318; font-size: .875rem; margin-top: .4rem; }
.review-inline-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; }
body .customer-create-form .form-container { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body .customer-result-card, body .idcard-item, body .item-card, body .draft-card, body .intake-choice, body .txn-card, body .transaction-mobile-card { border: 1px solid var(--rule); border-radius: 8px; box-shadow: none; }
body .customer-result-card:hover, body .item-card:hover, body .draft-card:hover, body .txn-card:hover { transform: none; background: var(--surface-muted); box-shadow: none; }
body .customer-result-card .crc-name, body .customer-result-card .crc-detail span { white-space: normal; overflow: visible; text-overflow: clip; }
body .customer-result-card .crc-inner { min-width: 0; }
body .store-card { border: 1px solid var(--rule); border-radius: var(--border-radius); background: white; box-shadow: none; margin-bottom: 1.25rem; }
body .store-name, body .store-address { white-space: normal; overflow: visible; text-overflow: clip; }
.intake-scan-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; margin-bottom: 1.25rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface-muted); }
.intake-scan-copy { flex: 1 1 240px; }
.intake-choice { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; height: 100%; padding: 1rem; background: white; text-align: left; color: var(--color-text-primary); }
.intake-choice:hover { border-color: var(--navy-700); }
.intake-choice-title { font-size: 1rem; font-weight: 600; }
.intake-choice-text { color: var(--color-text-muted); font-size: .875rem; }
.intake-choice-icon { color: var(--navy-700); font-size: 1.25rem; }
.serial-justification { padding: 1rem; border: 1px solid #e5ca90; border-radius: var(--radius-control); background: #fffbf0; }
.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid #b9c5d3; border-radius: var(--radius-control); min-height: 44px; padding: .55rem .8rem; color: var(--color-text-secondary); background: white; font-size: .9rem; font-weight: 500; }
.chip.active { border-color: var(--navy-800); background: var(--navy-800); color: white; }
.id-form-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
body .draft-idcard-creator { padding: var(--pane-pad); }
/* Empty upload tiles size to their controls; only a selected image uses the ID ratio. */
body .draft-idcard-creator .id-upload-zone.empty-zone { aspect-ratio: auto; max-height: none; min-height: 14rem; flex-shrink: 0; padding: 1rem; overflow: visible; }
body .draft-idcard-creator .empty-zone .upload-prompt { width: 100%; min-width: 0; }
body .draft-idcard-creator .empty-zone .upload-actions { min-width: 0; }
body .draft-idcard-creator .empty-zone .upload-actions .btn { min-width: 0; min-height: 44px; max-width: 100%; padding-inline: .75rem !important; }
.id-scan-modes { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.id-scan-mode { flex: 1 1 110px; min-height: 44px; background: white; border: 0; border-bottom: 3px solid transparent; padding: .6rem; color: var(--color-text-secondary); font-size: .9rem; font-weight: 600; }
.id-scan-mode.active { color: var(--navy-800); border-bottom-color: var(--navy-800); background: var(--surface-muted); }
body .id-scan-modal .id-scan-option { padding: 0; border: 0; }
body .item-image-gallery .gallery-header { flex-wrap: wrap; gap: .75rem; }
body .item-image-gallery .gallery-header > .d-flex { min-width: 0; flex-wrap: wrap; }
body .item-image-gallery .modern-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
body .item-image-gallery:has(input[id^="item-camera-"]:focus-visible) label[for^="item-camera-"],
body .item-image-gallery:has(input[id^="item-gallery-"]:focus-visible) label[for^="item-gallery-"] { outline: 3px solid #2276b9; outline-offset: 3px; }
body .item-image-gallery .image-overlay { opacity: 1; }
body .item-image-gallery .action-btn { min-width: 44px; min-height: 44px; }
body .item-manager .item-actions .btn, body .item-manager .item-action-btn { min-width: 44px; min-height: 44px; }
body .item-manager .item-brand-model, body .item-manager .item-description, body .item-manager .tag { white-space: normal; overflow-wrap: anywhere; }
body .item-manager .item-description { overflow: visible; text-overflow: clip; }
body .item-manager .item-header-row { min-width: 0; flex-wrap: wrap; }
body .item-form-actions > div { min-width: 0; }
body .item-form-actions .btn { min-width: 0; min-height: 48px; text-align: center; }
.workflow-page fieldset { min-width: 0; }
.invite-summary { padding: 1rem 0; border-block: 1px solid var(--rule); }
.inv-search-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.sidebar-dev { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-bottom: .75rem; font-size: .8rem; }
.sidebar-dev__label { color: #b9c5d3; }
.sidebar-dev__option { border: 1px solid #627184; padding: .35rem .55rem; color: white; border-radius: 4px; text-decoration: none; }
.sidebar-dev__option.active { background: #234f7e; }

/* Directory and settings pages keep the same readable controls as intake. */
.record-name-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; color: var(--navy-800); text-decoration: underline; text-underline-offset: .15em; overflow-wrap: anywhere; }
.inventory-results-heading, .inventory-item-heading, .inventory-item-footer { flex-wrap: wrap; gap: .75rem; min-width: 0; }
.inventory-item-heading > div, .inventory-item-footer > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.inventory-item-name { flex: 1 1 160px; }
.inventory-item-heading > .text-end { flex: 0 1 auto; }
body .profile-nav-pills { width: 100%; }
body .profile-nav-pills .nav-link { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; min-height: 44px; width: 100%; }
body .profile-nav-pills .nav-link > i { margin-inline: 0 !important; }
.settings-page .section-card-body .d-flex > div { min-width: 0; }
.settings-page .section-card-body .text-muted { overflow-wrap: anywhere; }
body .txn-card-top, body .txn-card-footer { flex-wrap: wrap; gap: .75rem; }
body .txn-card-top > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 991.98px) {
    body .workflow-action-bar { left: 0; right: 0; border-inline: 0; align-items: stretch; gap: .55rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); }
    body .workflow-action-bar .context-content { width: 100%; flex-basis: 100%; }
    body .workflow-action-bar .context-content:empty { display: none; }
    body .workflow-action-bar .context-content:has(> .fw-semibold:only-child) { display: none; }
    body .workflow-action-bar .context-content > .fw-semibold { display: none; }
    body .workflow-action-bar .action-buttons { flex: 1 1 100%; }
    body .workflow-action-bar .action-buttons .btn { flex: 1 1 0; }
}
@media (max-width: 650px) { .workflow-page .pane-row { grid-template-columns: minmax(0, 1fr); } .workflow-page .pane-row > .pane + .pane { border-left: 0; border-top: 1px solid var(--rule); } }
@media (max-width: 575.98px) {
    body .settings-page { padding-top: 0 !important; }
    body .settings-page .section-card-body:has(> .profile-avatar) { flex-direction: row !important; align-items: center; gap: 1rem !important; padding: 1rem !important; }
    body .settings-page .profile-avatar { width: 48px; height: 48px; margin-inline: 0 !important; }
    body .settings-page .profile-avatar > i { font-size: 1.75rem; }
    body .settings-page .profile-avatar + div { text-align: left !important; }
    body .settings-page .profile-avatar + div > h4 { font-size: 1rem; line-height: 1.4; }
    body .settings-page .profile-avatar + div > .d-flex { justify-content: flex-start !important; }
    body .settings-page .profile-tab-body form > .d-flex.gap-2 { flex-wrap: wrap; }
    body .settings-page .profile-tab-body form > .d-flex.gap-2 > .btn { flex: 1 1 0; min-width: 0; }
    body .drafts-page > .page-header > .d-flex { flex-wrap: wrap; width: 100%; }
    body .drafts-page > .page-header > .d-flex > .btn-primary { flex: 1 1 0; }
    body .draft-idcard-creator form > fieldset > .row > .col-12:last-child > .d-flex > .btn { flex: 1 1 0; min-width: 0; min-height: 48px; }
    body .customer-result-card .crc-header { flex-wrap: wrap; }
    body .customer-result-card .crc-status { margin-left: 0; }
    .intake-scan-bar > .btn, .intake-scan-bar > .id-barcode-scanner { width: 100%; }
    .intake-scan-bar .intake-scan-button { width: 100%; }
    .workflow-page .intake-scan-copy { flex-basis: 100%; }
    .workflow-page .transaction-review .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .workflow-page .transaction-review .row-item { align-items: flex-start; gap: .6rem; }
    .workflow-page .transaction-review .row-end { max-width: 100%; overflow-wrap: anywhere; }
    .review-inline-actions .btn { flex: 1 1 0; }
    body .item-form-actions > div:last-child .btn { flex: 1 1 0; }
    body .item-image-gallery .gallery-header > .d-flex { width: 100%; }
    body .item-image-gallery .gallery-header > .d-flex .btn { flex: 1 1 0; padding-inline: .6rem !important; }
    body .item-image-gallery .empty-state-global .btn { flex: 1 1 125px; padding-inline: .6rem !important; }
}
@media print { .bottom-nav, .workflow-action-bar, .skip-link { display: none !important; } .layout-wrapper { display: block; } .main-content-wrapper { min-height: 0; } .table-responsive, .receipt-table { overflow: visible; } body .content-container { padding: 0; } }
