/* ---------- shared by dashboard / transfer / settings / login ---------- */
html:where([data-page="dashboard"], [data-page="transfer"], [data-page="settings"], [data-page="log"], [data-page="login"]) {
  height: 100%;
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"])::-webkit-scrollbar, :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
/* ---------- shared by dashboard / transfer / settings / login ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"], html[data-page="login"]) body {
  height: 100%;
}
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"], html[data-page="login"]) body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}
/* [026] A theme switch lands in one frame: every transition is held for the
   frame the colours change in (toggleTheme), so no part catches up later. */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: none !important;
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"])::-webkit-scrollbar-track, :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) *::-webkit-scrollbar-track {
  background: transparent;
}
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"])::-webkit-scrollbar-thumb, :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) *::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 2px solid var(--surface);
  background-clip: padding-box;
}
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"])::-webkit-scrollbar-thumb:hover, :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) *::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  border-color: var(--surface);
  background-clip: padding-box;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .icon-16 {
  width: 16px;
  height: 16px;
}
:where(html[data-shell="app"]) .icon-20 {
  width: 20px;
  height: 20px;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
/* [Uniformity, 4 Sep 2026] ONE toast component. It was 21 rules with three
   different geometries, spread over 4,800 lines of this file, and .toast-item.error
   alone was written out four times identically.

   The Scanner was never the odd one out: its layout IS the <=640px layout
   below, hardcoded, because it is a phone page. Above 640px it now joins the
   other three - the only visible change here, and Mustafa's call.

   z-index 301 is measured, not chosen. settings.html puts a confirm dialog at
   300 and its toast was already 301 to clear it; the other three sat at 201,
   BELOW their own .sheet-overlay at 220, so a toast raised while a sheet was
   open was painted behind it. 301 clears every overlay on every page. */
:where(html[data-shell="app"]) .toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 301;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
:where(html[data-shell="app"]) .toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity var(--duration-slow) var(--ease),transform var(--duration-slow) var(--ease);
  pointer-events: auto;
  max-width: 360px;
  /* The swipe is ours: the browser must not scroll or zoom under it. */
  touch-action: none;
  user-select: none;
  cursor: grab;
}
:where(html[data-shell="app"]) .toast-item.show {
  opacity: 1;
  transform: translateX(0);
}
/* Under a finger the toast follows it with no lag; on release the transition
   comes back, so it springs home or slides out. */
:where(html[data-shell="app"]) .toast-item.dragging {
  transition: none;
  cursor: grabbing;
}
/* No colour of its own: the icon inherits from .toast-item, so the state rules
   below carry it. Giving it one is what left the Dashboard with a green line
   beside a grey tick until 4 Sep 2026. */
:where(html[data-shell="app"]) .toast-item .toast-icon {
  flex-shrink: 0;
}
:where(html[data-shell="app"]) .toast-item.success {
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  color: var(--success);
}
:where(html[data-shell="app"]) .toast-item.error {
  border-color: color-mix(in srgb, var(--error) 40%, transparent);
  color: var(--error);
}
:where(html[data-shell="app"]) .toast-item.warn {
  border-color: color-mix(in srgb, var(--warning) 40%, transparent);
  color: var(--warning);
}
@media (max-width: 640px) {
  :where(html[data-shell="app"]) .toast-stack {
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: auto;
    align-items: stretch;
  }
  :where(html[data-shell="app"]) .toast-item {
    max-width: none;
    transform: translateY(-10px);
  }
  :where(html[data-shell="app"]) .toast-item.show {
    transform: translateY(0);
  }
}
:where(html[data-shell="app"]) .icon-24 {
  width: 24px;
  height: 24px;
}
:where(html[data-shell="app"]) .sm-wordmark {
  font-family: 'Playfair Display',serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--brand-color);
  line-height: 1;
  padding-left: 8px;
  user-select: none;
  /* [specs/014] The name comes from Settings and may be 60 characters: one
     line, cut, and the menu keeps its width. `overflow: hidden` cuts at the
     padding edge and a line-height of 1 leaves the descender of a 'p' outside
     the line, so the box is padded and pulled back by the same amount - it
     takes the room it always took. */
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-block: 6px;
  margin-block: -6px;
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .app {
  display: flex;
  min-height: 100vh;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu-toggle:hover {
  color: var(--accent);
  background: var(--hover-bg);
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu-toggle .sm-expand {
  display: none;
}
/* ---------- shared by transfer / settings ---------- */
:where(html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .page-inner {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu-item:hover {
  color: var(--text);
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .side-menu-item.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
:where(html[data-shell="app"]) .sm-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
:where(html[data-shell="app"]) .side-menu.collapsed .sm-foot {
  flex-direction: column;
  gap: 4px;
}
:where(html[data-shell="app"]) .side-menu.collapsed .sm-foot .side-menu-item {
  align-self: stretch;
}
:where(html[data-shell="app"]) .sm-theme-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-base) ease, background var(--duration-base) ease;
}
:where(html[data-shell="app"]) .sm-theme-btn:hover {
  color: var(--text);
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .sm-theme-btn svg {
  width: 16px;
  height: 16px;
}
/* The icon names the theme that is on. */
:where(html[data-shell="app"]) .sm-theme-btn .tt-sun {
  display: none;
}
:where(html[data-shell="app"])[data-theme="light"] .sm-theme-btn .tt-sun {
  display: block;
}
:where(html[data-shell="app"])[data-theme="light"] .sm-theme-btn .tt-moon {
  display: none;
}
:where(html[data-shell="app"]) .side-menu-drawer .sm-theme-btn {
  width: 44px;
  height: 44px;
}
:where(html[data-shell="app"]) .side-menu-drawer .sm-theme-btn svg {
  width: 20px;
  height: 20px;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="log"], html[data-page="login"]) .field-input:focus {
  border-color: var(--accent);
}
:where(html[data-page="settings"], html[data-page="log"], html[data-page="login"]) .field-input::placeholder {
  color: var(--text-placeholder);
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu.collapsed .sm-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
:where(html[data-shell="app"]) .side-menu.collapsed .sm-user-text {
  display: none;
}
:where(html[data-shell="app"]) .side-menu-drawer .sm-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
:where(html[data-shell="app"]) .side-menu-drawer .sm-user-name {
  font-size: 14px;
}
:where(html[data-shell="app"]) .side-menu-drawer .sm-user-role {
  font-size: 11px;
}
:where(html[data-shell="app"]) .side-menu-item svg {
  flex-shrink: 0;
}
:where(html[data-shell="app"]) .side-menu.collapsed {
  width: 56px;
  padding: 14px 8px;
}
:where(html[data-shell="app"]) .side-menu.collapsed .side-menu-head {
  justify-content: center;
}
:where(html[data-shell="app"]) .side-menu.collapsed .sm-wordmark {
  display: none;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="login"]) .pass-toggle.showing .eye {
  display: none;
}
:where(html[data-page="settings"], html[data-page="login"]) .pass-toggle.showing .eye-off {
  display: block;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu.collapsed .side-menu-toggle .sm-collapse {
  display: none;
}
:where(html[data-shell="app"]) .side-menu.collapsed .side-menu-toggle .sm-expand {
  display: block;
}
:where(html[data-shell="app"]) .side-menu.collapsed .side-menu-item {
  justify-content: center;
  padding: 10px 0;
}
:where(html[data-shell="app"]) .side-menu.collapsed .side-menu-item .smi-label {
  display: none;
}
:where(html[data-shell="app"]) .side-menu-drawer.open {
  display: block;
}
:where(html[data-shell="app"]) .side-menu-drawer .drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}
@media (max-width: 640px) {
  :where(html[data-shell="app"]) .side-menu {
    display: none;
  }
  :where(html[data-shell="app"]) .menu-toggle:active {
    background: var(--hover-bg);
  }
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .header-text h1 {
  font-family: 'Playfair Display',serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .header-text p {
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 2px;
}
/* ---------- shared by dashboard / scanner ---------- */
:where(html[data-page="dashboard"], html[data-page="scanner"]) .btn-icon:active {
  transform: scale(0.94);
}
/* ---------- shared by dashboard / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap thead th {
  background: var(--surface2);
  padding: 10px 12px;
  text-align: left;
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody tr:last-child {
  border-bottom: none;
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody tr:hover {
  background: var(--hover-bg);
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody td {
  padding: 12px;
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
@media (min-width: 768px) {
  :where(html[data-shell="app"]) .sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  :where(html[data-shell="app"]) .sheet {
    max-width: 420px;
    border-radius: 20px;
    border: 1px solid var(--border);
  }
}
/* ---------- shared by dashboard / settings ---------- */
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 10px;
    padding: 4px 14px;
    background: var(--surface);
  }
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody tr:last-child {
    border-bottom: 1px solid var(--border);
  }
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    white-space: normal;
    text-align: right;
  }
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody td::before {
    content: attr(data-label);
    font-family: 'DM Sans',sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: left;
  }
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody td:first-child::before {
    content: '';
  }
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="transfer"]) .tab-count {
  opacity: 0.7;
  margin-left: 4px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-input::placeholder {
  color: var(--text-placeholder);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-input:focus {
  outline: none;
  border-color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="log"]) #mainFilters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip-label b {
  font-weight: 600;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-result b {
  color: var(--accent);
  font-weight: 600;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-dow span {
  text-align: center;
  font-size: 9px;
  color: var(--text-muted);
  font-family: 'DM Sans',sans-serif;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day.blank {
  visibility: hidden;
  cursor: default;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day:hover:not(.blank):not(.edge) {
  background: var(--hover-bg);
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day.today {
  border: 1.3px solid var(--accent);
}
@media (max-width: 560px) {
  :where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal {
    flex-direction: column;
  }
  :where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-shorts {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
  }
  :where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-short {
    flex: 1 1 auto;
    text-align: center;
  }
}
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-search {
    max-width: none;
    flex-basis: 100%;
  }
}
:where(html[data-page="scanner"]) .app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}
:where(html[data-page="scanner"]) .page {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: width var(--duration-base) var(--ease);
}
:where(html[data-shell="app"]) .side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 32px;
}
:where(html[data-shell="app"]) .side-menu-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color var(--duration-base) ease, background var(--duration-base) ease;
}
:where(html[data-shell="app"]) .side-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 11px;
  text-decoration: none;
  transition: color var(--duration-base) ease, background var(--duration-base) ease;
  white-space: nowrap;
}
:where(html[data-shell="app"]) .sm-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 6px;
  min-width: 0;
}
:where(html[data-shell="app"]) .sm-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 11px;
  user-select: none;
}
:where(html[data-shell="app"]) .sm-user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
:where(html[data-shell="app"]) .sm-user-name {
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:where(html[data-shell="app"]) .sm-user-role {
  font-family: 'DM Sans',sans-serif;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:where(html[data-shell="app"]) .side-menu-drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
:where(html[data-shell="app"]) .menu-toggle {
  display: none;
}
@media (max-width: 640px) {
  :where(html[data-page="scanner"]) .header-left, :where(html[data-page="scanner"]) .header-actions {
    gap: 8px;
  }
}
/* ---------- shared by dashboard / scanner ---------- */
:where(html[data-page="dashboard"], html[data-page="scanner"]) .btn-icon:hover {
  border-color: var(--accent-hover);
  color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="transfer"]) .tab-btn:hover {
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-input:hover {
  border-color: var(--accent-hover);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-add:hover {
  border-color: var(--accent-hover);
  color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-back:hover {
  color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt:hover {
  background: var(--hover-bg);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip-label:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip-x:hover {
  color: var(--error);
  opacity: 1;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-short:hover {
  background: var(--hover-bg);
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-nav:hover {
  color: var(--accent);
  background: var(--hover-bg);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-clear:hover {
  border-color: var(--accent-hover);
  color: var(--accent);
}
:where(html[data-page="scanner"]) .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) thead th.col-qty {
  width: 140px;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) thead th.col-del {
  width: 44px;
}
/* The menu hangs UNDER the button and is aligned to its right edge, so it opens
   into the page rather than off it: the button sits at the far right of the bar
   (Mustafa, 2026-09-16 - it was drifting out to the right and reading as a
   stray box). Its width is the item's, not the anchor's. */
/* `.fb-pop.add-sku-menu`, not `.add-sku-menu`: the base .fb-pop is written
   further down this file and would otherwise win on source order and drag the
   menu back to left: 0 (Mustafa, 2026-09-16 - it kept opening rightward). */
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop.add-sku-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  /* .fb-pop is 260px wide and anchored left, which on a button at the far right
     of the bar pushed the menu past the edge of the page and raised a sideways
     scrollbar (Mustafa, 2026-09-16). One item, so it takes the item's width and
     hangs from the button's right edge. */
  width: max-content;
  min-width: 0;
  max-width: min(260px, calc(100vw - 48px));
  z-index: 60;
  text-align: left;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .cell-input:focus {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .cell-input::placeholder {
  color: var(--text-placeholder);
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .del-row-btn:hover {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 10%, transparent);
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .add-row-btn:hover, :where(html[data-page="transfer"], html[data-page="dashboard"]) .import-btn:hover, :where(html[data-page="transfer"], html[data-page="dashboard"]) .import-btn[aria-expanded="true"] {
  border-color: var(--accent-hover);
  color: var(--accent);
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .import-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .import-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .grid-footer {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .grid-footer .add-row-btn, :where(html[data-page="transfer"], html[data-page="dashboard"]) .grid-footer .import-btn {
    width: 100%;
    justify-content: center;
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .cell-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .del-row-btn {
    width: auto;
    margin-left: auto;
    padding: 8px 14px;
  }
}
/* ---------- page: settings ---------- */
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .side-menu-drawer .drawer-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 65%;
  max-width: 280px;
  background: var(--surface2);
  box-shadow: 6px 0 20px rgba(0,0,0,0.4);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
:where(html[data-shell="app"]) .side-menu-drawer .side-menu-item {
  font-size: 13px;
  padding: 12px 10px;
  min-height: 44px;
}
/* ---------- page: settings ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .st-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
/* ---------- shared by dashboard / transfer / settings ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .header-left, :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* ---------- shared by dashboard / scanner ---------- */
:where(html[data-page="dashboard"], html[data-page="scanner"]) .btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease, transform var(--duration-fast) var(--ease);
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="transfer"]) .tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="transfer"]) .tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding-bottom: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-base) ease, border-color var(--duration-base) ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 190px;
  max-width: 320px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-search-icon {
  position: absolute;
  left: 10px;
  display: flex;
  pointer-events: none;
  color: var(--text-muted);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 12px;
  padding: 6px 10px 6px 32px;
  transition: border-color var(--duration-base) ease;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-anchor {
  position: relative;
  display: inline-flex;
}
:where(html[data-page="dashboard"]) .sort-pop {
  width: min(220px, calc(100vw - 48px));
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-add {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 11px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
/* A popover is positioned against `.fb-anchor`, which wraps a single BUTTON. On
   a phone that button sits far enough to the right that a 260px panel starts
   inside the screen and ends outside it - `width: min(260px, 100vw - 48px)`
   caps how WIDE the panel gets and says nothing about where it starts, so the
   list ran off the edge and had to be scrolled sideways to be read.

   Below 640px the anchor goes `static`, which hands the popover to the BAR as
   its containing block; left:0 and right:0 then span the bar exactly. It is
   done this way rather than by right-aligning the panel because right-aligning
   only moves the problem to whichever button sits nearest the other edge - this
   holds for every button in the bar, including ones added later.

   Both bars are covered: the transfer list uses `.fb-row` and the detail sheet
   uses `.filter-bar`. They are two different class names for the same row, and
   fixing only the one in the screenshot would have left the other broken. */
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-row,
  :where(html[data-page="dashboard"]) .filter-bar {
    position: relative;
  }
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-anchor {
    position: static;
  }
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop,
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop.is-cal {
    left: 0;
    right: 0;
    width: auto;
  }
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: min(260px, calc(100vw - 48px));
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  padding: 6px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 15px;
  line-height: 1;
  border-radius: 4px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop-title {
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans',sans-serif;
  font-size: 12px;
  color: var(--text);
  min-height: 36px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt-chevron {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-empty {
  padding: 12px 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 30px;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--accent);
  border-radius: 20px;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip-label {
  background: none;
  border: none;
  color: var(--accent);
  font-family: 'DM Sans',sans-serif;
  font-size: 11px;
  padding: 6px 4px 6px 12px;
  cursor: pointer;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-chip-x {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  opacity: 0.75;
  padding: 6px 10px 6px 6px;
  font-size: 13px;
  line-height: 1;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-result {
  font-family: 'DM Sans',sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt-val {
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The SKU count beside each value in the detail filter popover.
   --text-muted and NOT --accent: a count is data, and the accent carries brand
   and emphasis only. 11px and the same token as .fb-result, which is the other
   count already on this screen, so the two read as one idea.
   tabular-nums keeps 9 and 11 the same width, so the numbers cannot nudge the
   labels sideways as filters change. .fb-opt-name holds flex:1, so the count
   needs no layout of its own - it lands at the right edge on its own. */
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-opt-count {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal {
  display: flex;
  align-items: stretch;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-shorts {
  width: 130px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-short {
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: 'DM Sans',sans-serif;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 6px;
  min-height: 32px;
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-grid {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 12px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-title {
  font-family: 'DM Sans',sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-nav {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: 6px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-dow {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 2px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-dow {
  margin-bottom: 4px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-days {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 2px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day {
  /* A fixed square, centred in its grid cell, so the 50% radius draws a
     circle. Stretched to the cell's width it drew an oval. */
  width: 30px;
  height: 30px;
  margin: 3px 0;
  justify-self: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-family: 'DM Sans',sans-serif;
  font-size: 11px;
  color: var(--text);
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-family: 'DM Sans',sans-serif;
  font-size: 10px;
  color: var(--text-muted);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-clear {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 11px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
:where(html[data-page="transfer"], html[data-page="settings"]) .select-chevron {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
/* ---------- shared by dashboard / transfer ---------- */
:where(html[data-page="dashboard"], html[data-page="transfer"]) .grid-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
:where(html[data-page="dashboard"]) .sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 220;
  display: none;
  align-items: flex-end;
}
/* ---------- page: transfer ---------- */
:where(html[data-page="transfer"], html[data-page="dashboard"]) .cell-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .del-row-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .grid-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .add-row-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 7px;
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  min-height: 36px;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
:where(html[data-page="transfer"], html[data-page="dashboard"]) .import-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 7px;
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  min-height: 36px;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
/* ---------- page: settings ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .st-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
:where(html[data-page="settings"], html[data-page="log"]) .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="login"]) .pass-toggle:hover {
  color: var(--accent);
}
/* ---------- page: settings ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .ghost-btn:hover {
  border-color: var(--accent-hover);
  color: var(--accent);
}
@media (max-width: 640px) {
  :where(html[data-page="settings"], html[data-page="log"]) .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
  }
}
/* ---------- page: settings ---------- */
@media (max-width: 640px) {
  :where(html[data-page="settings"], html[data-page="log"]) .st-header {
    padding: 8px 16px;
  }
  :where(html[data-page="settings"], html[data-page="log"]) .st-body {
    padding: 16px;
  }
}
/* ---------- shared by dashboard / settings ---------- */
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap thead {
    display: none;
  }
}
/* ---------- shared by dashboard / settings ---------- */
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tbody, :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap td {
    display: block;
    width: 100%;
  }
  :where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="log"]) .grid-wrap tr {
    display: block;
  }
}
/* ---------- page: login ---------- */
/* ---------- page: dashboard ---------- */
:where(html[data-page="dashboard"], html[data-page="settings"], html[data-page="transfer"]) .tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop[hidden], :where(html[data-page="dashboard"], html[data-page="log"]) .fb-chips[hidden], :where(html[data-page="dashboard"], html[data-page="log"]) .fb-result[hidden] {
  display: none;
}
:where(html[data-page="dashboard"], html[data-page="log"]) .fb-pop.is-cal {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  max-height: none;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-short.active {
  background: rgba(213,169,153,0.10);
  color: var(--accent);
  font-weight: 600;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-nav.next {
  color: var(--accent);
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day.in-range {
  background: rgba(213,169,153,0.10);
  border-radius: 6px;
}
:where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-day.edge {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: var(--on-accent);
  font-weight: 700;
  border-radius: 50%;
}
/* ---------- hover tooltip (Style Guide 16 / 22) ----------
   The Style Guide's tooltip carries a label for an icon-only button at 10px.
   This variant carries something a person READS - a stock figure on the
   Dashboard, a sentence explaining a permission in Settings - so it sits at
   11px; everything else - the --bg bubble, the 6px radius, the triangle - is
   that component unchanged.

   [Item 63] It was called .odoo-tip when the Dashboard was its only caller.
   Settings now uses the same component, and a second COPY of it would drift
   from this one within a session or two, so the name was generalised rather
   than duplicated. The Dashboard's behaviour did not change by a pixel.

   It is fixed and lives on <body> because '.grid-wrap' is 'overflow: hidden'
   and scrolls on desktop: anchored inside a row it would be clipped by its own
   table. The cursor is the only hint that a cell has something to say, and
   both it and the bubble exist ONLY where there is a real mouse. */
/* [Mustafa, after using it] The dotted underline is gone: on a column of SKUs
     it read as noise rather than as an affordance. The cursor is kept - it costs
     nothing visually and still answers "is there something here?". */
@media (hover: hover) and (pointer: fine) {
  :where(html[data-page="dashboard"], html[data-page="settings"]) .tip {
    cursor: help;
  }
}
/* [Item 63] The dotted underline was BACK on Settings for one version and is
     now gone from there too (Mustafa, after using it). The argument for keeping
     it was that the 25 permission notes are otherwise undiscoverable, and that
     argument was put and lost: the dots read as noise on a list of labels the
     same way they read as noise on a column of SKUs. Both pages now carry the
     cursor and nothing else, which is also the first time this component looks
     identical on both of them. */
:where(html[data-page="dashboard"], html[data-page="settings"]) .tip-bubble {
  position: fixed;
  z-index: 3000;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
:where(html[data-page="dashboard"], html[data-page="settings"]) .tip-bubble.show { opacity: 1; }
:where(html[data-page="dashboard"], html[data-page="settings"]) .tip-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--border);
  top: 100%;
}
:where(html[data-page="dashboard"], html[data-page="settings"]) .tip-bubble.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border);
}
:where(html[data-page="settings"], html[data-page="log"]) .empty-state .sub {
  font-family: 'DM Sans',sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="login"]) .pass-toggle .eye-off {
  display: none;
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
:where(html[data-shell="app"]) .sheet-overlay.open {
  display: flex;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="login"]) .pass-field-wrap {
  position: relative;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="log"], html[data-page="login"]) .field-label {
  font-family: 'DM Sans',sans-serif;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 7px;
  display: block;
}
/* ---------- page: settings ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-base) ease;
}
/* ---------- shared by settings / login ---------- */
:where(html[data-page="settings"], html[data-page="login"]) .pass-toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 10px;
  display: flex;
  align-items: center;
  transition: color var(--duration-base) ease;
}
/* ---------- shared by settings / login ---------- */
/* ---------- shared by scanner / transfer / settings ---------- */
:where(html[data-page="scanner"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 220;
  display: none;
  align-items: flex-end;
}
/* ---------- shared by dashboard / scanner / transfer ---------- */
:where(html[data-page="dashboard"], html[data-page="scanner"], html[data-page="transfer"]) .sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
/* ---------- page: settings ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
/* ---------- page: transfer ---------- */
/* ---------- shared by dashboard / transfer ---------- */
/* ---------- shared by settings / log ---------- */
:where(html[data-page="settings"], html[data-page="log"]) .ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 13px 26px;
  border-radius: var(--radius);
  font-family: 'DM Sans',sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  min-height: 46px;
  transition: border-color var(--duration-base) ease, color var(--duration-base) ease;
}
/* A confirmation: icon beside the words, the buttons side by side in a footer
   bar, the one that goes ahead on the right (Mustafa, 2026-10-17 - option 2 of
   five previewed). Every page, every confirmation: the Dashboard's askConfirm,
   Settings' showConfirm, Log Out, and the confirmation sheets of Transfer and
   Scanner. Two classes, so it wins over .sheet and .confirm-box on any order. */
:where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd {
  max-width: 440px;
  padding: 0;
  gap: 0;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
}
:where(html[data-shell="app"]) .cd-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 22px 22px 20px;
}
:where(html[data-shell="app"]) .cd-text {
  flex: 1;
  min-width: 0;
}
/* What a dialog carries besides its words - Odoo's stock figure, the quantity
   to remove, the day to import - sits under them, in the same column. */
:where(html[data-shell="app"]) .cd-text > :not(.cd-title):not(.cd-sub) {
  margin-top: 14px;
}
:where(html[data-shell="app"]) .cd-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
}
:where(html[data-shell="app"]) .cd-icon svg {
  width: 20px;
  height: 20px;
}
:where(html[data-shell="app"]) .cd-icon.accent {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
:where(html[data-shell="app"]) .cd-icon.success {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}
:where(html[data-shell="app"]) .cd-title {
  margin: 2px 0 6px;
  font-family: 'DM Sans',sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
:where(html[data-shell="app"]) .cd-sub {
  font-family: 'DM Sans',sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
:where(html[data-shell="app"]) .cd-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
:where(html[data-shell="app"]) .cd-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-base) ease, filter var(--duration-base) ease;
}
:where(html[data-shell="app"]) .cd-btn:hover {
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .cd-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:where(html[data-shell="app"]) .cd-btn.danger {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
:where(html[data-shell="app"]) .cd-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
:where(html[data-shell="app"]) .cd-btn.danger:hover {
  background: var(--error);
  filter: brightness(1.08);
}
:where(html[data-shell="app"]) .cd-btn.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
:where(html[data-shell="app"]) .cd-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
/* On a phone the dialog sits on the bottom edge: the buttons share the row,
   44px tall, a thumb's target; three that do not fit wrap to a second row. */
@media (max-width: 640px) {
  :where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd {
    max-width: none;
  }
  :where(html[data-shell="app"]) .cd-foot {
    flex-wrap: wrap;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  :where(html[data-shell="app"]) .cd-btn {
    flex: 1 1 auto;
    height: 44px;
  }
}
/* A data dialog: the confirmation above carrying a form, a list or a table
   (Mustafa, 2026-10-17 - option 2 of five previewed). The data sits in
   .cd-data, under the words and in their column, and the whole dialog fits the
   window: a long list spreads into columns (.cd-cols), a long table turns into
   pages (.cd-pager). .cd-data scrolls only when the window is too short for
   even that - the title and the buttons never leave the screen. */
:where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd {
  max-height: calc(100dvh - 48px);
}
/* stretch, so the text column takes the body's height and .cd-data can be held
   inside it; the icon keeps its own 40px. */
:where(html[data-shell="app"]) .cd-body {
  min-height: 0;
  align-items: stretch;
}
:where(html[data-shell="app"]) .cd-body > .cd-icon {
  align-self: flex-start;
}
:where(html[data-shell="app"]) .cd-text {
  min-height: 0;
}
:where(html[data-shell="app"]) .cd-text {
  display: flex;
  flex-direction: column;
}
:where(html[data-shell="app"]) .cd-foot {
  flex-shrink: 0;
}
:where(html[data-shell="app"]) .cd-data {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}
:where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd.cd-wide {
  max-width: 720px;
}
:where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd.cd-mid {
  max-width: 560px;
}
:where(html[data-shell="app"]) .cd-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:where(html[data-shell="app"]) .cd-field + .cd-field {
  margin-top: 10px;
}
/* Fields 34px tall where the old forms had 45-48px, so a four-field form fits a
   laptop screen with its buttons. */
:where(html[data-shell="app"]) .cd .field-label {
  display: block;
  margin: 0 0 4px;
  font-family: 'DM Sans',sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}
:where(html[data-shell="app"]) .cd :is(.field-input, .sheet-input) {
  width: 100%;
  height: 34px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
  text-align: left;
}
:where(html[data-shell="app"]) .cd :is(.field-input, .sheet-input):focus {
  border-color: var(--accent);
}
:where(html[data-shell="app"]) .cd .role-select {
  padding-right: 32px;
}
:where(html[data-shell="app"]) .cd .role-select-chevron {
  right: 10px;
}
:where(html[data-shell="app"]) .cd .pass-field-wrap .field-input {
  padding-right: 38px;
}
:where(html[data-shell="app"]) .cd .pass-toggle {
  top: 2px;
  bottom: 2px;
  right: 2px;
  padding: 0 8px;
}
:where(html[data-shell="app"]) .cd .color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}
/* An error takes no room until there is one. */
:where(html[data-shell="app"]) .cd .field-error {
  min-height: 0;
  margin-top: 4px;
  font-size: 11.5px;
}
:where(html[data-shell="app"]) .cd .field-error:empty {
  display: none;
}
:where(html[data-shell="app"]) .cd .fo-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
/* The one button that is not the way forward or back - Delete, Refresh - sits
   on the left of the footer, away from the two the hand goes to. */
:where(html[data-shell="app"]) .cd-foot .cd-lead {
  margin-right: auto;
}
:where(html[data-shell="app"]) .cd-btn.danger-ghost {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
}
:where(html[data-shell="app"]) .cd-btn.danger-ghost:hover {
  background: color-mix(in srgb, var(--error) 8%, transparent);
}
:where(html[data-shell="app"]) .cd-btn:has(svg) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
:where(html[data-shell="app"]) .cd-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
/* A list spreads into as many 200px columns as the dialog holds. */
:where(html[data-shell="app"]) .cd-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 12px;
}
:where(html[data-shell="app"]) .cd-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans',sans-serif;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:where(html[data-shell="app"]) .cd-pager button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
:where(html[data-shell="app"]) .cd-pager button:hover:not(:disabled) {
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .cd-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}
:where(html[data-shell="app"]) .cd-pager button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:where(html[data-shell="app"]) .cd-pager svg {
  width: 14px;
  height: 14px;
}
/* A phone: the icon gives its width to the data, and the fields grow to 40px
   with 16px text, the size below which iOS zooms in on a field. */
@media (max-width: 640px) {
  :where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd {
    max-height: calc(100dvh - 16px);
  }
  :where(html[data-shell="app"]) :is(.sheet, .confirm-box).cd:is(.cd-wide, .cd-mid) {
    max-width: none;
  }
  :where(html[data-shell="app"]) .cd:has(.cd-data) .cd-body > .cd-icon {
    display: none;
  }
  :where(html[data-shell="app"]) .cd:has(.cd-data) .cd-body {
    padding: 18px 16px 16px;
  }
  :where(html[data-shell="app"]) .cd :is(.field-input, .sheet-input) {
    height: 40px;
    font-size: 16px;
  }
  :where(html[data-shell="app"]) .cd .color-swatch {
    width: 40px;
    height: 40px;
  }
  :where(html[data-shell="app"]) .cd-foot .cd-pager {
    flex-basis: 100%;
    justify-content: center;
  }
  :where(html[data-shell="app"]) :is(.cd-cols, .cd-choices) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Two columns of names on a phone, so a long list of pickers stays on it. */
:where(html[data-shell="app"]) .cd-icon.warning {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning);
}
/* "Which one is it?": one row per SKU, numbered, in columns when there are
   many. A button, so the colour is set: a button does not inherit it. */
:where(html[data-shell="app"]) .cd-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}
:where(html[data-shell="app"]) .cd-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans',sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}
:where(html[data-shell="app"]) .cd-choice:hover,
:where(html[data-shell="app"]) .cd-choice:focus-visible {
  border-color: var(--accent);
  background: var(--hover-bg);
  outline: none;
}
:where(html[data-shell="app"]) .cd-choice-n {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
:where(html[data-shell="app"]) .cd-pager[hidden] {
  display: none;
}
/* A table in a data dialog: no frame, a quiet header, the cells wrap rather
   than push the dialog sideways. */
:where(html[data-shell="app"]) .cd-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans',sans-serif;
  font-size: 13px;
}
:where(html[data-shell="app"]) .cd-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 8px 0;
  border-bottom: 1px solid var(--border);
}
:where(html[data-shell="app"]) .cd-table td {
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  overflow-wrap: anywhere;
}
:where(html[data-shell="app"]) .cd-table tr:last-child td {
  border-bottom: 0;
}
:where(html[data-shell="app"]) .cd-table .col-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
:where(html[data-shell="app"]) .cd-table td:last-child {
  white-space: nowrap;
}
@media (max-width: 640px) {
  :where(html[data-shell="app"]) .cd-table th {
    letter-spacing: 0;
  }
  :where(html[data-shell="app"]) .cd-table :is(th, td) {
    padding-right: 6px;
  }
}
@media (max-width: 640px) {
  :where(html[data-page="dashboard"], html[data-page="log"]) .fb-search {
    max-width: none;
  }
  :where(html[data-page="dashboard"], html[data-page="scanner"], html[data-page="settings"], html[data-page="log"], html[data-page="transfer"]) .side-menu {
    display: none;
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .cell-input {
    background: var(--surface2);
    border: 1px solid var(--border);
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .del-row-btn {
    padding: 8px 14px;
    width: auto;
  }
  :where(html[data-page="transfer"], html[data-page="dashboard"]) .grid-footer {
    align-items: stretch;
  }
}
@media (max-width: 560px) {
  :where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-cal-shorts {
    border-right: none;
    flex-direction: row;
    width: 100%;
  }
  :where(html[data-page="dashboard"], html[data-page="log"], html[data-page="transfer"]) .fb-short {
    text-align: center;
  }
}
@media (min-width: 768px) {
  :where(html[data-page="dashboard"], html[data-page="scanner"], html[data-page="settings"], html[data-page="log"], html[data-page="transfer"]) .sheet {
    border-radius: 20px;
  }
  :where(html[data-page="dashboard"], html[data-page="scanner"], html[data-page="settings"], html[data-page="log"], html[data-page="transfer"]) .sheet-overlay {
    align-items: center;
  }
}
/* ---------- shared by dashboard / scanner / transfer / settings ---------- */
/* 🔴 A SHEET SHORTER THAN ITS OWN max-height HAS NOTHING TO SCROLL, so the
   wheel travels straight past it to the page underneath and the list behind
   the popup moves instead. That is what happened on Manage Role: six roles
   never reach the 92vh ceiling, so the sheet is not a scrolling thing at all
   and every scroll went to the Users table behind it.

   The bug has two halves and needs both rules:
     · the page itself is frozen for as long as any overlay is open, which
       covers the backdrop and every sheet too short to scroll;
     · `overscroll-behavior: contain` stops a sheet that IS long enough from
       handing the scroll onward once it reaches its own end.

   `overflow: hidden` on the root keeps the scroll offset, so the page is
   exactly where it was when the overlay closes - a lock that scrolls the page
   to the top on open is a worse bug than the one being fixed. */
html:where([data-shell="app"]):has(.sheet-overlay.open, .confirm-overlay.open, .modal-overlay.open, .detail-overlay.open, .side-menu-drawer.open) {
  overflow: hidden;
}
/* Inert on anything that is not a scroll container, so this is safe to state
   once for every panel that can scroll rather than hunting them one by one. */
:where(html[data-shell="app"]) .sheet,
:where(html[data-shell="app"]) .perm-options,
:where(html[data-shell="app"]) .side-menu-drawer {
  overscroll-behavior: contain;
}
/* [Mustafa, 2026-10-21] THE SPINNER'S ROOM IS RESERVED, NOT TAKEN.
   A words-only button sized to its words had 14px each side; the spinner and
   its gap need 24px, so setBtnLoading pushed the words to 3px off the right
   edge. A button that waits never changes size (a growing one pushes its
   neighbour), so the words-only buttons that wait carry 24px each side all the
   time: waiting, the words move 12px right and keep 12px to either edge.
   Buttons with an icon are left out - the spinner takes the icon's place. */
:where(html[data-shell="app"]) :is(.cd-btn:not(:has(svg)), .btn-secondary, .fb-add.wait-room) {
  padding-left: 24px;
  padding-right: 24px;
}
/* ---------- HEADER ICON BUTTONS (specs/015) ----------
   Refresh, Back and the bell in the header bar are the bare icon: no box round
   it, a little smaller, and a soft square only on hover (Mustafa, 2026-10-05).
   The two-class selector outranks the single-class .btn-icon rules above,
   phone-width ones included, so it applies wherever it sits in this file.
   Actions and Close at the top of the detail sheet (.do-header-actions) are
   drawn the same way. */
:where(html[data-shell="app"]) .header-actions {
  gap: 6px;
}
:where(html[data-shell="app"]) .header-actions .btn-icon,
:where(html[data-shell="app"]) .do-header-actions .btn-icon,
:where(html[data-shell="app"]) .header-actions .bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-base) ease, color var(--duration-base) ease, transform var(--duration-fast) var(--ease);
}
:where(html[data-shell="app"]) .header-actions .btn-icon svg,
:where(html[data-shell="app"]) .do-header-actions .btn-icon svg,
:where(html[data-shell="app"]) .header-actions .bell-btn svg {
  width: 18px;
  height: 18px;
}
:where(html[data-shell="app"]) .header-actions .btn-icon:hover,
:where(html[data-shell="app"]) .do-header-actions .btn-icon:hover,
:where(html[data-shell="app"]) .header-actions .bell-btn:hover,
:where(html[data-shell="app"]) .header-actions .bell-btn[aria-expanded="true"] {
  background: var(--hover-bg);
  color: var(--accent);
}
:where(html[data-shell="app"]) .header-actions .btn-icon:active,
:where(html[data-shell="app"]) .do-header-actions .btn-icon:active,
:where(html[data-shell="app"]) .header-actions .bell-btn:active {
  transform: scale(0.94);
}
/* A finger needs more than a mouse does; with no box drawn, the extra is invisible. */
@media (max-width: 640px) {
  :where(html[data-shell="app"]) .header-actions .btn-icon,
  :where(html[data-shell="app"]) .do-header-actions .btn-icon,
  :where(html[data-shell="app"]) .header-actions .bell-btn {
    width: 40px;
    height: 40px;
  }
}
/* ---------- THE BELL (specs/015) ---------- */
:where(html[data-shell="app"]) .bell-count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
/* The panel drops from the bell. common.js sets top, left and --bell-pointer. */
:where(html[data-shell="app"]) .bell-panel {
  position: fixed;
  z-index: 90;
  width: min(400px, calc(100vw - 20px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
:where(html[data-shell="app"]) .bell-panel::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--bell-pointer, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
:where(html[data-shell="app"]) .bell-panel-head {
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Sans',sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
:where(html[data-shell="app"]) .bell-list {
  max-height: min(60vh, 420px);
  overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
:where(html[data-shell="app"]) .bell-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px 12px 13px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Sans',sans-serif;
  font-size: 13.5px;
  line-height: 18px;
  color: var(--text);
  text-decoration: none;
}
:where(html[data-shell="app"]) .bell-item:last-child {
  border-bottom: 0;
}
:where(html[data-shell="app"]) .bell-item:hover {
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .bell-item.unseen {
  border-left-color: var(--accent);
  background: var(--hover-bg);
}
:where(html[data-shell="app"]) .bell-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--text-muted);
}
:where(html[data-shell="app"]) .bell-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
:where(html[data-shell="app"]) .bell-kind {
  font-weight: 600;
}
:where(html[data-shell="app"]) .bell-kind-ready { color: var(--success); }
:where(html[data-shell="app"]) .bell-kind-stalled { color: var(--warning); }
:where(html[data-shell="app"]) .bell-kind-unsent,
:where(html[data-shell="app"]) .bell-kind-unsynced { color: var(--error); }
:where(html[data-shell="app"]) .bell-ago {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
:where(html[data-shell="app"]) .bell-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
/* last, so it beats the display rules above */
:where(html[data-shell="app"]) .header-actions .bell-btn[hidden],
:where(html[data-shell="app"]) .bell-count[hidden],
:where(html[data-shell="app"]) .bell-panel[hidden] {
  display: none;
}
/* ---------- every page: the scrollbar starts under the header ----------
   (Mustafa, 2026-10-18.) The window used to scroll, so its scrollbar ran the
   full height of the screen, past the header. On a screen 768px and wider the
   page is held to the window's height and only the part under the header
   scrolls. A phone keeps the window's own scroll: its scrollbar is drawn
   over the page and hidden at rest, and its browser bar folds away only when
   the window itself scrolls.
   Every page fills the window (Mustafa, 2026-11-07): no page caps its
   width, so the content is as wide on one page as on the next and a zoom
   only rescales it. The scroll area - and its scrollbar - reach the
   window's right edge. */
@media (min-width: 768px) {
  :where(html[data-shell="app"]) .app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }
  :where(html[data-shell="app"]) .page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  :where(html[data-page="dashboard"], html[data-page="transfer"], html[data-page="settings"], html[data-page="log"]) .page > .page-inner {
    max-width: none;
    margin: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---------- PLACEHOLDER (specs/026) ----------
   What a list shows while its first reply is on the way, written in the page
   itself so it is in the first frame. The reply replaces it in place. Cards
   (Dashboard) and table rows (Log, Settings) take the same pulsing line. */
:where(html[data-shell="app"]) .skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
:where(html[data-shell="app"]) .skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  animation: pulse 1.4s ease-in-out infinite;
}
/* Written through .grid-wrap tbody so they outweigh the table's own cell rules,
   the phone's card layout included. */
:where(html[data-shell="app"]) .grid-wrap tbody .skeleton-row td {
  padding-block: 16px;
}
/* On a phone a table row is a card with a label per cell; a placeholder row has none. */
:where(html[data-shell="app"]) .grid-wrap tbody .skeleton-row td::before {
  content: none;
}
/* ---------- page: dashboard, transfer - the Create in Shopify dialog ----------
   The spinner of a request on its way, the error text, and the Status dot and
   label of the shortfall rows. Moved here from dashboard.css when the Transfer
   page began drawing the same dialog (specs/030). */
:where(html[data-page="dashboard"], html[data-page="transfer"]) .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-label {
  font-weight: 600;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-dot.partial {
  background: var(--warning);
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-dot.notfound {
  background: var(--error);
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-label.partial {
  color: var(--warning);
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .status-label.notfound {
  color: var(--error);
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .cd .sheet-error {
  max-height: none;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .cd .cd-note {
  margin-top: 12px;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .cd .sheet-working {
  justify-content: flex-start;
  padding: 0;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .sheet-error {
  font-family: 'DM Sans',sans-serif;
  font-size: 12px;
  color: var(--error);
  line-height: 1.6;
  background: color-mix(in srgb, var(--error) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 25%, transparent);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  user-select: text;
}
:where(html[data-page="dashboard"], html[data-page="transfer"]) .sheet-working {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}
