/* Shared workspace surfaces. Page IDs, loaders, and business data remain owned by each module. */
html:root {
  --sidebar-w: 258px;
  --topbar-h: 88px;
  --bg: #f5f7f8;
  --panel: #fff;
  --panel-2: #f8faf9;
  --text: #20362e;
  --muted: #74827b;
  --line: #e3eae6;
  --shadow: 0 3px 16px rgba(28, 53, 40, .035);
  --workspace-green: #176b50;
  --workspace-soft: #eaf4ee;
  --workspace-sidebar: #fff;
  --sidebar-bg: #fff;
  --sidebar-bg-2: #fff;
  --sidebar-text: #4d6157;
  --sidebar-subtext: #7d8f84;
  --sidebar-line: #e3eae6;
}
html:root[data-theme="dark"] {
  --bg: #14211c; --panel: #1b2c24; --panel-2: #22352b; --text: #e4f0e8;
  --muted: #a7beb0; --line: #344a3e; --workspace-green: #92d6b4;
  --workspace-soft: #294535; --workspace-sidebar: #19281f;
  --sidebar-bg: #19281f; --sidebar-bg-2: #19281f; --sidebar-text: #d3e4d9;
  --sidebar-subtext: #a7beb0; --sidebar-line: #344a3e;
}
body.workspace-ui { background: var(--bg); color: var(--text); }
body.workspace-ui .sidebar, body.workspace-ui .drawer-panel { background: var(--workspace-sidebar); color: var(--sidebar-text); }
body.workspace-ui .sidebar { border-right: 1px solid var(--line); }
body.workspace-ui .sidebar-top { padding: 24px 20px 20px; border-bottom: 0; }
body.workspace-ui .brand-row { gap: 11px; align-items: center; }
body.workspace-ui .brand-logo-wrap { width: 48px; height: 48px; min-width: 48px; border-radius: 13px; background: #edf5ef; border: 1px solid #e0ebe3; padding: 5px; box-shadow: none; }
body.workspace-ui .brand-logo { max-width: 100%; width: 100%; height: 100%; max-height: 48px; object-fit: contain; }
body.workspace-ui .brand-meta strong { font-size: 17px; color: var(--text); }
body.workspace-ui .brand-meta span { font-size: 11px; color: var(--muted); margin-top: 5px; }
body.workspace-ui .sidebar-scroll { padding: 4px 14px 20px; }
.workspace-nav-caption { font-size: 11px; color: var(--muted); padding: 22px 10px 10px; }
body.workspace-ui .menu-section { border: 0; margin: 5px 0; }
body.workspace-ui .menu-section.open { border: 0; background: transparent; }
body.workspace-ui .menu-trigger, body.workspace-ui .single-link, body.workspace-ui .drawer-trigger { min-height: 46px; padding: 11px 12px; color: var(--sidebar-text); border: 0; border-radius: 9px; background: transparent; box-shadow: none; }
body.workspace-ui .menu-trigger:hover, body.workspace-ui .single-link:hover, body.workspace-ui .drawer-trigger:hover { background: var(--panel-2); }
body.workspace-ui .menu-label { font-size: 13px; font-weight: 400; }
body.workspace-ui .menu-trigger-left { display: flex; align-items: center; gap: 11px; }
body.workspace-ui .menu-icon { background: transparent; width: 20px; height: 20px; color: var(--muted); }
body.workspace-ui .menu-icon svg { width: 20px; height: 20px; }
body.workspace-ui .menu-chevron { width: 14px; height: 14px; color: var(--muted); }
body.workspace-ui .submenu, body.workspace-ui .drawer-submenu { background: transparent; padding: 3px 0 5px 18px; margin: 0 0 0 20px; border-left: 1px solid var(--line); border-radius: 0; }
body.workspace-ui .submenu a, body.workspace-ui .submenu button, body.workspace-ui .drawer-submenu a, body.workspace-ui .drawer-submenu button { padding: 9px 10px; min-height: 38px; line-height: 1.5; border-radius: 7px; color: var(--sidebar-text); font-size: 12px; font-weight: 400; border: 0; }
body.workspace-ui .submenu a:hover, body.workspace-ui .submenu button:hover, body.workspace-ui .drawer-submenu a:hover { background: var(--panel-2); }
body.workspace-ui .submenu a.active, body.workspace-ui .drawer-submenu a.active { background: var(--workspace-soft); color: var(--workspace-green); font-weight: 500; box-shadow: none; }
body.workspace-ui .single-link.active { background: #176b50; color: #fff; box-shadow: 0 3px 9px #176b5015; }
body.workspace-ui .single-link.active .menu-icon { color: #fff; }
body.workspace-ui .sidebar-bottom { padding: 14px 20px; border-color: var(--line); box-shadow: none; background: var(--workspace-sidebar); }
body.workspace-ui .logout-wide { background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 12px; }
body.workspace-ui .topbar { min-height: 88px; height: auto; background: var(--panel); border-bottom: 1px solid var(--line); padding: 18px 32px; gap: 20px; }
body.workspace-ui .topbar-title h1 { font-size: 23px; line-height: 1.4; font-weight: 500; color: var(--text); }
body.workspace-ui .topbar-title p { font-size: 12px; font-weight: 300; color: var(--muted); line-height: 1.6; margin-top: 3px; }
body.workspace-ui .topbar-right { gap: 14px; }
body.workspace-ui .status-pill { padding: 0; border: 0; background: transparent; font-size: 11px; color: var(--muted); }
body.workspace-ui .status-dot { width: 6px; height: 6px; box-shadow: none; }
body.workspace-ui .user-chip { border: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); background: transparent; gap: 9px; border-radius: 0; }
body.workspace-ui .avatar { background: var(--workspace-soft); color: var(--workspace-green); width: 36px; height: 36px; font-size: 14px; border-radius: 50%; }
body.workspace-ui .user-meta strong { font-size: 12px; font-weight: 500; }
body.workspace-ui .user-meta span { font-size: 10px; color: var(--muted); }
body.workspace-ui .page { padding: 0 32px 88px; gap: 20px; min-width: 0; }
.workspace-context { padding: 18px 32px 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.workspace-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.workspace-breadcrumb a { text-decoration: none; color: var(--muted); }
.workspace-breadcrumb strong { font-weight: 400; color: var(--text); }
.workspace-related { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.workspace-related-label { font-size: 10px; color: var(--muted); margin-right: 3px; }
.workspace-related-link { text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font-size: 11px; color: var(--workspace-green); background: var(--panel); transition: border-color .15s; }
.workspace-related-link:hover { border-color: var(--workspace-green); }
.workspace-search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 8px; padding: 9px 10px; font: inherit; cursor: pointer; text-align: left; }
.workspace-search-trigger svg, .workspace-search-field svg, .workspace-search-result svg { width: 18px; height: 18px; flex-shrink: 0; }
.workspace-search-trigger span { font-size: 11px; flex: 1; }
.workspace-search-trigger kbd { font: 10px system-ui; white-space: nowrap; border: 1px solid var(--line); padding: 3px; border-radius: 4px; }
.workspace-top-search { width: 36px; min-height: 36px; justify-content: center; background: transparent; }
.workspace-top-search span, .workspace-top-search kbd { display: none; }
.workspace-search-dialog { width: min(620px, calc(100vw - 32px)); padding: 24px; max-height: min(76vh, 740px); margin: 10vh auto auto; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 80px #0e2f2940; }
.workspace-search-dialog::backdrop { background: #132b2570; backdrop-filter: blur(3px); }
.workspace-search-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.workspace-search-head h2 { font-size: 18px; font-weight: 500; margin: 0; }
.workspace-search-head button { width: 36px; height: 36px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 24px system-ui; cursor: pointer; }
.workspace-search-field { display: flex; gap: 12px; align-items: center; border: 1px solid var(--workspace-green); padding: 0 14px; border-radius: 9px; }
.workspace-search-field input { border: 0; outline: 0; min-width: 0; width: 100%; padding: 14px 0; font: inherit; font-size: 14px; color: var(--text); background: transparent; }
.workspace-search-meta { display: flex; justify-content: space-between; margin: 14px 0; font-size: 11px; color: var(--muted); }
#workspaceSearchResults { display: grid; gap: 3px; }
.workspace-search-result { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px; color: var(--text); text-decoration: none; border-radius: 8px; }
.workspace-search-result:hover, .workspace-search-result:focus-visible { background: var(--workspace-soft); }
.workspace-search-result strong { display: block; font-size: 14px; font-weight: 500; }
.workspace-search-result small { display: block; font-size: 11px; margin-top: 3px; color: var(--muted); }
.workspace-search-empty { padding: 24px 4px; color: var(--muted); font-size: 14px; }
.workspace-filter-note { flex-basis: 100%; width: 100%; margin: 0; font-size: 11px; color: var(--muted); }
.workspace-preview-notice { padding: 9px 14px; border-radius: 8px; font-size: 11px; color: #816118; background: #fff7dc; border: 1px solid #f0e5c6; }

/* Consistent panels, controls, tables, and metric cards across all route modules. */
body.workspace-ui #pageContent { --dash-card: var(--panel); --dash-ink: var(--text); --dash-muted: var(--muted); --dash-line: var(--line); --dash-green: var(--workspace-green); }
body.workspace-ui #pageContent > section { min-width: 0; gap: 20px; }
body.workspace-ui #pageContent :is(.panel, [class$="-panel"], .products-toolbar-panel, .settings-block, .metric, [class$="-metric"], .product-card) { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
body.workspace-ui #pageContent :is(.hero, [class$="-hero"]) { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; box-shadow: none; }
body.workspace-ui #pageContent :is(.hero, [class$="-hero"])::before { display: none; }
body.workspace-ui #pageContent :is(.hero, [class$="-hero"]) h2 { color: var(--text); font-size: 21px; font-weight: 500; line-height: 1.5; }
body.workspace-ui #pageContent :is(.hero, [class$="-hero"]) p { color: var(--muted); font-size: 13px; font-weight: 300; line-height: 1.8; }
body.workspace-ui #pageContent :is(.panel-title h3, [class$="-panel"] h3) { color: var(--text); font-size: 17px; font-weight: 500; }
body.workspace-ui #pageContent :is(.metric, [class$="-metric"]) strong { color: var(--text); font-size: 29px; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums; }
body.workspace-ui #pageContent :is(.metric, [class$="-metric"]) small { font-size: 12px; font-weight: 400; color: var(--muted); }
body.workspace-ui #pageContent :is(.metric, [class$="-metric"]) span { font-size: 11px; font-weight: 300; color: var(--muted); }
body.workspace-ui #pageContent :is(.btn, [class$="-btn"]) { border-radius: 8px; box-shadow: none; min-height: 40px; font-family: inherit; font-weight: 400; }
body.workspace-ui #pageContent :is(.btn-primary, .items-btn-primary, .inventory-btn-primary, .settings-save-btn) { color: #fff; background: #176b50; border-color: #176b50; }
body.workspace-ui #pageContent :is(.btn-soft, .btn-light, .items-btn-light) { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
body.workspace-ui #pageContent :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea) { color: var(--text); background-color: var(--panel); border-color: var(--line); border-radius: 8px; box-shadow: none; font-family: inherit; }
body.workspace-ui #pageContent select { min-height: 42px; }
body.workspace-ui #pageContent table { font-size: 12px; border-collapse: collapse; }
body.workspace-ui #pageContent th { font-weight: 500; color: var(--muted); background: var(--panel-2); padding: 13px 16px; border-color: var(--line); }
body.workspace-ui #pageContent td { padding: 14px 16px; color: var(--text); border-color: var(--line); }
body.workspace-ui #pageContent tbody tr:hover { background: var(--panel-2); }
body.workspace-ui #pageContent :is(.empty-state, [class$="-empty"]) { color: var(--muted); background: var(--panel-2); border-color: var(--line); border-radius: 10px; font-weight: 300; }
body.workspace-ui :is(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #6ab193; outline-offset: 3px; }
body.workspace-ui button:disabled { cursor: not-allowed; opacity: .55; }
body.workspace-ui .drawer-header { background: var(--workspace-sidebar); border-color: var(--line); }
body.workspace-ui .drawer-links { padding: 12px 16px 30px; }
body.workspace-ui .drawer-section { background: transparent; border: 0; }
body.workspace-ui .drawer-trigger { width: 100%; }
body.workspace-ui .drawer-close { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
body.workspace-ui .menu-btn { color: var(--text); background: var(--panel); border: 1px solid var(--line); }
body.workspace-ui .sushi-assistant-fab, body.workspace-ui .sushi-tour-fab { border-radius: 50%; width: 44px; height: 44px; background: var(--panel); }
body.workspace-ui .sushi-avatar, body.workspace-ui .sushi-tour-icon { border-radius: 50%; }

/* Dashboard: a clear reading order, with secondary actions under disclosure. */
body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero-row > div:first-child { display: block; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero { border: 0; background: transparent; padding: 4px 0 0; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero h2 { font-size: 25px; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero p { max-width: 570px; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .badge { font-size: 10px; font-weight: 400; padding: 4px 9px; margin-bottom: 10px; color: var(--workspace-green); background: var(--workspace-soft); border-color: var(--line); }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .toolbar { padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.workspace-filter-label { display: grid; gap: 5px; font-size: 11px; color: var(--muted); }
.workspace-more-actions { position: relative; }
.workspace-more-actions summary { padding: 10px 14px; font-size: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#dashboardPrintActions { position: absolute; right: 0; top: calc(100% + 7px); z-index: 10; min-width: 240px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 12px 28px #10261920; display: grid; gap: 5px; }
body.workspace-ui #dashboardPrintActions button { width: 100%; font-size: 12px; text-align: left; justify-content: flex-start; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .card-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric { min-height: 142px; padding: 20px; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric::after { display: none; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric:has(#netSales) { background: #176b50; border-color: #176b50; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric:has(#netSales) :is(strong, small) { color: #fff; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric:has(#netSales) span { color: #c6e3d5; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .grid-2 { grid-template-columns: 1.5fr 1fr; gap: 20px; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .panel { padding: 22px; }
.workspace-panel-link { font-size: 11px; color: var(--workspace-green); text-decoration: none; }
.workspace-panel-link:hover { text-decoration: underline; }
body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero .btn::before { display: none; }
html:root[data-theme="dark"] body.workspace-ui #pageContent .page-section { --dash-card: var(--panel); --dash-ink: var(--text); --dash-muted: var(--muted); --dash-line: var(--line); --dash-soft: var(--workspace-soft); }
@media (max-width: 1280px) {
  .workspace-context { display: grid; }
  .workspace-related { margin-left: 0; }
  body.workspace-ui .topbar { padding: 18px 24px; }
  body.workspace-ui .topbar-right .status-pill { display: none; }
  body.workspace-ui .page { padding-left: 24px; padding-right: 24px; }
  .workspace-context { padding-left: 24px; padding-right: 24px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body.workspace-ui .topbar { padding: 14px 16px; gap: 10px; align-items: center; }
  body.workspace-ui .topbar-left { width: auto; flex: 1; min-width: 0; }
  body.workspace-ui .topbar-title h1 { font-size: 20px; }
  body.workspace-ui .topbar-title p { display: none; }
  body.workspace-ui .topbar-right { display: flex; width: auto; }
  body.workspace-ui .topbar-right .user-chip { display: none; }
  body.workspace-ui .page { padding: 0 16px 80px; }
  .workspace-context { padding: 14px 16px 18px; gap: 12px; }
  .workspace-related { gap: 6px; }
  .workspace-related-label { width: 100%; }
  .workspace-related-link { font-size: 11px; min-height: 32px; display: inline-flex; align-items: center; }
  body.workspace-ui #pageContent :is(.hero, [class$="-hero"]) { padding: 18px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .hero h2 { font-size: 22px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric { min-height: 122px; padding: 16px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric:first-child { grid-column: 1 / -1; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .metric strong { font-size: 26px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .panel { padding: 16px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .toolbar { padding: 14px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .filters { width: 100%; grid-template-columns: 1fr 1fr; gap: 8px; }
  body.workspace-ui[data-workspace-route="dashboard"] .page-section .control { padding-left: 10px; font-size: 12px; }
  .workspace-more-actions { width: 100%; }
  #dashboardPrintActions { left: 0; min-width: 0; }
  .workspace-search-dialog { padding: 18px; }
  .workspace-search-head h2 { font-size: 16px; }
}
@media print {
  .workspace-context, .workspace-search-trigger, .workspace-preview-notice, .workspace-filter-note, .workspace-search-dialog { display: none !important; }
}
body.workspace-ui .sidebar .brand-row { flex-direction: row; text-align: left; }
body.workspace-ui .sidebar .brand-meta { text-align: left; }
body.workspace-ui #pageContent .workspace-panel-link::before { display: none; }
.workspace-filter-note { flex: 0 0 auto; min-width: 0; max-width: 100%; }
body.workspace-ui .drawer-brand-wrap { display: flex; flex-direction: row; gap: 12px; align-items: center; color: var(--text); }
body.workspace-ui .drawer-header { padding: 18px 16px; }
body.workspace-ui #pageContent .header { padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
body.workspace-ui #pageContent .header h2 { font-size: 21px; font-weight: 500; }
body.workspace-ui #pageContent .header p { font-size: 13px; font-weight: 300; line-height: 1.8; color: var(--muted); }
body.workspace-ui #pageContent :is(.settings-sidebar-card, .settings-content-card) { border-radius: 12px; box-shadow: var(--shadow); }
body.workspace-ui #pageContent .settings-nav-item.active { background: var(--workspace-soft); color: var(--workspace-green); }
@media (max-width: 780px) {
  body.workspace-ui #pageContent .settings-sidebar-head { display: none; }
  body.workspace-ui #pageContent .settings-nav-group { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
  body.workspace-ui #pageContent .settings-nav-item { width: auto; flex: 1 1 auto; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; font-weight: 400; text-align: center; background: var(--panel); color: var(--text); }
  body.workspace-ui #pageContent .settings-nav-item.active { background: var(--workspace-soft); color: var(--workspace-green); border-color: #a9cabb; }
}

/* Clear recovery, mobile controls and keyboard navigation. */
.workspace-drawer-footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
body.workspace-ui .workspace-drawer-footer .logout-wide { background: var(--panel); color: var(--danger); border: 1px solid var(--line); min-height: 44px; box-shadow: none; }
.workspace-page-state { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 60px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.workspace-state-symbol { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--workspace-green); background: var(--workspace-soft); font-size: 24px; }
.workspace-page-state h2 { margin: 0; font-size: 20px; font-weight: 500; }
.workspace-page-state p { margin: 0; color: var(--muted); font-size: 14px; }
.workspace-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.workspace-page-state details { margin-top: 14px; max-width: 100%; color: var(--muted); font-size: 12px; }
.workspace-page-state summary { cursor: pointer; }
.workspace-page-state pre { max-width: 580px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
body.workspace-ui :is(button, a, input, select, summary, [tabindex]):focus-visible { outline: 3px solid #269878; outline-offset: 3px; }
body.workspace-ui #pageContent button:disabled { cursor: not-allowed; opacity: .55; }
body.workspace-ui[data-workspace-route="dashboard"] #dataStatusBadge { color: var(--workspace-green) !important; background: var(--workspace-soft) !important; }
body.workspace-ui .settings-placeholder .btn { display: inline-flex; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) {
  body.workspace-ui *, body.workspace-ui *::before, body.workspace-ui *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Keep summaries and filters within reach on smaller screens. */
body.workspace-ui #pageContent :is(.hero, [class$="-hero"]) :is(.badge, [class$="-badge"]) { padding: 4px 9px; margin-bottom: 10px; background: var(--workspace-soft); color: var(--workspace-green); border-color: var(--line); font-size: 11px; font-weight: 400; }
body.workspace-ui[data-workspace-route="dashboard"] #pageContent .hero { padding: 4px 0 0; border: 0; background: transparent; }
body.workspace-ui #pageContent #receiptDetailBackdrop .modal { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
body.workspace-ui #pageContent #receiptDetailBackdrop .modal-head { position: sticky; top: -24px; z-index: 2; background: var(--panel); padding: 16px 0; border-bottom: 1px solid var(--line); }
body.workspace-ui #pageContent #receiptDetailBackdrop .modal-head h2 { font-size: 21px; font-weight: 500; }
body.workspace-ui #pageContent #receiptDetailBackdrop .modal-head p { font-size: 12px; color: var(--muted); }
body.workspace-ui #pageContent #receiptDetailBackdrop .receipts-panel { padding: 16px; }
body.workspace-ui #pageContent :is(#receiptDetailMeta, #receiptDetailTotals) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
body.workspace-ui #pageContent :is(#receiptDetailMeta, #receiptDetailTotals) .list-item { display: block; padding: 8px 0; border: 0; background: transparent; min-width: 0; }
body.workspace-ui #pageContent :is(#receiptDetailMeta, #receiptDetailTotals) strong { display: block; margin: 0; font-size: 11px; font-weight: 400; color: var(--muted); }
body.workspace-ui #pageContent :is(#receiptDetailMeta, #receiptDetailTotals) p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
body.workspace-ui #pageContent #receiptDetailTotals .list-item:last-child { padding: 10px; border-radius: 8px; background: var(--workspace-soft); color: var(--workspace-green); }
@media (max-width: 680px) {
  body.workspace-ui[data-workspace-route="dashboard"] #pageContent .hero-row > div:last-child { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; }
  body.workspace-ui[data-workspace-route="dashboard"] #pageContent .hero-row .btn { width: 100%; padding: 8px 6px; min-height: 42px; font-size: 12px; }
  body.workspace-ui #pageContent [class$="-metric-grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.workspace-ui #pageContent [class$="-metric"] { min-width: 0; padding: 14px; }
  body.workspace-ui #pageContent [class$="-metric"] strong { font-size: 24px; overflow-wrap: anywhere; }
  body.workspace-ui #pageContent .receipts-metric:has(#receiptsNetTotal) { order: -1; grid-column: 1 / -1; background: #176b50; color: white; }
  body.workspace-ui #pageContent .receipts-metric:has(#receiptsNetTotal) :is(small, strong, span) { color: white; }
  body.workspace-ui #pageContent :is(.receipts-toolbar-left, .items-toolbar-left) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  body.workspace-ui #pageContent :is(.receipts-toolbar-left, .items-toolbar-left) > * { min-width: 0; width: 100%; }
  body.workspace-ui #pageContent :is(.receipts-toolbar-right, .items-toolbar-right) { width: 100%; }
  body.workspace-ui #pageContent :is(.receipts-search, .items-search) { min-width: 0; width: 100%; }
  body.workspace-ui #pageContent #receiptDetailBackdrop .modal-head { top: -16px; }
}
/* Seven item metrics need enough room for currency values on desktop. */
body.workspace-ui #pageContent .items-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.workspace-ui #pageContent [class$="-metric"] strong { overflow-wrap: anywhere; }
@media (min-width: 681px) and (max-width: 1280px) {
  body.workspace-ui #pageContent .items-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  body.workspace-ui #pageContent .items-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

body.workspace-ui[data-workspace-route="dashboard"] #dataStatusBadge[data-status="warn"] { color: #805610 !important; background: #fff2cf !important; }
body.workspace-ui[data-workspace-route="dashboard"] #dataStatusBadge[data-status="danger"] { color: #a12e2a !important; background: #ffebe9 !important; }

/* Save recovery and live sync share a compact status pattern across pages. */
.workspace-live-status,.workspace-draft-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:12px 16px;margin:0 0 16px;border:1px solid #dce9e1;border-radius:12px;background:#f3f9f5;color:#315342;font-size:13px;line-height:1.65;min-width:0}
.workspace-live-status [data-live-text],.workspace-draft-status>span{flex:1;min-width:180px;overflow-wrap:anywhere}
.workspace-live-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#25845a}
.workspace-live-status[data-phase="offline"],.workspace-live-status[data-phase="error"],.workspace-live-status[data-phase="cached"]{background:#fff8eb;border-color:#edd8ac;color:#73501c}
.workspace-live-status:not([data-phase="live"]) .workspace-live-dot{background:#ac7d2c}
.workspace-live-status button,.workspace-draft-status button{font:inherit;border:1px solid #bdcfc3;border-radius:8px;padding:7px 11px;min-height:40px;background:#fff;color:#245a3b;cursor:pointer}
.workspace-draft-status>div{display:flex;flex-wrap:wrap;gap:8px}
.workspace-draft-status [hidden],.workspace-live-status [hidden]{display:none!important}
.workspace-draft-status button:focus-visible,.workspace-live-status button:focus-visible{outline:3px solid #77aa8b;outline-offset:2px}
.stock-badge.untracked,.stock-status.untracked{background:#f0f2f4;color:#627069}
@media(max-width:600px){.workspace-live-status,.workspace-draft-status{padding:11px 12px}.workspace-draft-status button,.workspace-live-status button{min-height:44px}}
