:root{
  --cream:#dacab1;
  --navy:#092f4d;
  --red:#921a24;
  --dark:#020b12;

  --bg:#f4eee4;
  --panel:#fffaf3;
  --panel-2:#f8efdf;
  --line:rgba(9,47,77,.14);
  --ink:#092f4d;
  --muted:rgba(9,47,77,.66);
  --green:#3e9b63;

  --light-bg:#f4eee4;
  --light-panel:#fffdf9;
  --light-line:#d6c9b3;
  --light-line-strong:#cbbba0;
  --light-ink:#092f4d;
  --light-muted:#6f7a85;

  --shadow:0 10px 28px rgba(9,47,77,.10);

  /* narrowed desktop menu so labels fit without wrapping */
  --menuW:236px;
  --radius:18px;
  --topbarH:78px;
  /* Shared admin menu/form width tokens — see .workflow-sheet block below */
  --admin-menu-min-width:160px;
  --admin-menu-max-width:240px;
  --admin-form-compact-max:min(360px, calc(100vw - 32px));
  --admin-form-small-max:min(360px, calc(100vw - 32px));
  --admin-form-large-max:min(360px, calc(100vw - 32px));
  --admin-submenu-max:min(360px, calc(100vw - 32px));
  --admin-z-popover:1200;
  --admin-z-menu:1400;
  --admin-z-submenu:1410;
  color-scheme:light;
}

/* Admin v2 visual rule: compact, icon-first controls should feel close to native iOS/macOS. */

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  height:100%;
  min-height:100%;
  background:var(--bg);
  color:var(--ink);
  font-family:-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-anchor:none;
  overflow:hidden;
}

body{
  min-height:100%;
}

.app-shell{
  height:100%;
  min-height:100%;
  overflow-anchor:none;
}

/* =========================
   VIEW TOGGLING
   ========================= */
.view{ display:none; }
.view.active{
  display:block;
  overflow-anchor:none;
}

/* =========================
   GLOBAL FORM / BUTTONS
   ========================= */
button,
input,
textarea,
select{
  font:inherit;
}

button{
  cursor:pointer;
}

.order-card,
.inventory-card,
.gallery-manager-item,
.gallery-manager-thumb,
.photo-thumb-wrap,
.photo-thumb-img,
.workflow-sheet,
.workflow-action-btn,
.admin-filter-popover,
.admin-filter-list button,
.topbar-icon-action,
.sale-photo-action-select,
.gallery-manager-action-select{
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}

.order-card,
.inventory-card,
.workflow-sheet,
.workflow-action-btn,
.photo-thumb-img{
  touch-action:manipulation;
}

input,
textarea,
select,
[contenteditable="true"]{
  user-select:text;
  -webkit-user-select:text;
  -webkit-touch-callout:default;
}

body.admin-longpress-armed,
body.admin-longpress-armed *:not(input):not(textarea):not(select):not([contenteditable="true"]){
  user-select:none !important;
  -webkit-user-select:none !important;
  -webkit-touch-callout:none !important;
  -webkit-tap-highlight-color:transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline:3px solid rgba(9,47,77,.14);
  outline-offset:2px;
}

.icon-btn,
button.secondary{
  border:none;
  border-radius:14px;
  background:#244866;
  color:var(--cream);
  /* Compact is the DEFAULT for every secondary button, on EVERY screen (32px,
     tight padding, .8rem text). font-size lives HERE (not only in a desktop
     media query) or mobile inherits the big body text and buttons wrap.
     Do NOT bump padding or font-size. See CLAUDE.md "BUTTONS ARE STANDARDIZED". */
  min-height:32px;
  padding:4px 12px;
  font-size:.8rem;
}

.icon-btn{
  min-width:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mobile-only{
  display:inline-flex;
}

.muted{
  color:var(--muted);
}

.status{
  color:var(--red);
  margin:0;
}

/* =========================
   SIDE MENU
   ========================= */
.side-menu{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:var(--menuW);
  background:#081c2c;
  color:var(--cream);
  padding:18px 10px;
  z-index:40;
  transform:translateX(-100%);
  transition:transform .2s ease;
  box-shadow:0 0 30px rgba(0,0,0,.35);
}

.side-menu.open{
  transform:translateX(0);
}

.side-menu-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:18px;
}

.brand-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.brand-logo{
  width:40px;
  height:40px;
  object-fit:contain;
  flex:0 0 auto;
  display:block;
}

.brand-row > div{
  min-width:0;
}

.brand-title{
  font-weight:600;
  color:var(--cream);
  line-height:1.05;
  font-size:1rem;
  white-space:nowrap;
}

.brand-subtitle{
  font-size:.86rem;
  color:rgba(218,202,177,.68);
  white-space:nowrap;
}

.side-nav{
  display:grid;
  gap:8px;
}

.nav-link{
  width:100%;
  border:none;
  background:transparent;
  color:var(--cream);
  text-align:left;
  padding:11px 12px;
  border-radius:12px;
  font:inherit;
  font-size:.98rem;
  line-height:1.2;
  cursor:pointer;
  white-space:nowrap;
}

.nav-link.active{
  background:#13314c;
}

.nav-group{
  display:grid;
  gap:6px;
}

.nav-parent{
  width:100%;
  border:none;
  background:#13314c;
  color:var(--cream);
  text-align:left;
  padding:11px 12px;
  border-radius:12px;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.nav-caret{
  font-size:.9rem;
  opacity:.8;
}

.nav-children{
  display:grid;
  gap:6px;
  padding-left:12px;
}

.nav-children.is-collapsed{
  display:none;
}

.nav-children .nav-link{
  font-size:.9rem;
  padding:9px 10px;
  color:rgba(218,202,177,.88);
}

.nav-main{
  font-weight:600;
  background:rgba(218,202,177,.06);
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.upload-panel{
  padding:16px 14px 28px;
}

#uploadView .upload-panel{
  padding:12px 12px 24px;
}

.upload-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:20px;
  padding:16px;
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}

.gallery-upload-card{
  display:grid;
  gap:12px;
  border-radius:18px;
  padding:13px;
  background:rgba(19,41,61,.96);
  box-shadow:none;
}

.upload-card-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px 12px;
}

.upload-card-heading > div:first-child{
  min-width:0;
}

.upload-card h2{
  margin:0 0 8px;
  color:var(--cream);
  font-size:1.2rem;
}

.gallery-upload-card h2,
.gallery-manager-card h2,
.map-card h2{
  margin:0 0 4px;
  font-size:1.05rem;
  line-height:1.15;
  letter-spacing:-.015em;
}

.gallery-upload-card .muted,
.gallery-manager-card .muted,
.map-card .muted{
  margin:0;
  font-size:.88rem;
  line-height:1.35;
}

.upload-section-block{
  margin:0;
}

.gallery-upload-card .label{
  display:block;
  margin:0 0 6px;
  color:rgba(218,202,177,.72);
  font-size:.75rem;
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.gallery-upload-card select{
  width:100%;
  min-height:40px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:14px;
  background:#244866;
  color:var(--cream);
  padding:0 38px 0 12px;
  font-weight:600;
  appearance:none;
  -webkit-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(218,202,177,.9) 50%),
    linear-gradient(135deg, rgba(218,202,177,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 12px) 17px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}

.upload-drop{
  display:grid;
  gap:6px;
  margin-top:16px;
  padding:22px 16px;
  border:2px dashed rgba(218,202,177,.35);
  border-radius:18px;
  background:rgba(255,255,255,.06);
  color:var(--cream);
  text-align:center;
  cursor:pointer;
}

.gallery-upload-card .upload-drop,
.store-editor-card .upload-drop{
  grid-template-columns:auto minmax(0, 1fr);
  gap:2px 10px;
  align-items:center;
  margin-top:0;
  padding:12px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:16px;
  background:rgba(218,202,177,.08);
  text-align:left;
  transition:
    background .16s ease,
    border-color .16s ease,
    transform .16s ease;
}

.gallery-upload-card .upload-drop:hover,
.store-editor-card .upload-drop:hover{
  background:rgba(218,202,177,.11);
  border-color:rgba(218,202,177,.24);
}

.gallery-upload-card .upload-drop:active,
.store-editor-card .upload-drop:active{
  transform:scale(.99);
}

.upload-drop-icon{
  grid-row:1 / span 2;
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:13px;
  background:rgba(218,202,177,.14);
  color:var(--cream);
}

.upload-drop-icon svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.upload-drop-title{
  font-weight:600;
  font-size:1rem;
}

.gallery-upload-card .upload-drop-title,
.store-editor-card .upload-drop-title{
  font-size:.98rem;
  line-height:1.1;
}

.upload-drop-note{
  color:var(--muted);
  font-size:.9rem;
}

.gallery-upload-card .upload-drop-note,
.store-editor-card .upload-drop-note{
  font-size:.78rem;
  line-height:1.25;
}

#galleryUploadInput,
#saleGlovePhotoInput,
#orderPhotoInput{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.upload-status{
  margin:14px 0 0;
  color:var(--muted);
}

.gallery-upload-card .upload-status,
.store-editor-card .upload-status{
  min-height:18px;
  margin:0;
  font-size:.82rem;
  line-height:1.35;
}

.upload-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.gallery-upload-card .upload-actions,
.store-editor-card .upload-actions{
  justify-content:flex-start;
  gap:8px;
  margin-top:0;
}

.gallery-upload-card .upload-actions button,
.store-editor-card .upload-actions button{
  min-height:38px;
  border-radius:13px;
  padding:0 14px;
  font-weight:600;
}

.gallery-upload-card .upload-primary:not(:disabled),
.store-editor-card .upload-primary:not(:disabled){
  background:rgba(218,202,177,.92);
  color:var(--navy);
}

.gallery-upload-card .upload-clear:not(:disabled),
.store-editor-card .upload-clear:not(:disabled){
  background:rgba(146,26,36,.18);
  color:#ffb8bf;
}

.upload-actions button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.gallery-upload-card .upload-actions button:disabled,
.store-editor-card .upload-actions button:disabled{
  opacity:.38;
}

.admin-action-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.admin-action-btn{
  width:auto;
  min-height:34px;
  border-radius:12px;
  padding:0 12px;
  font-size:.84rem;
  font-weight:600;
}

.admin-action-btn-primary:not(:disabled){
  background:rgba(218,202,177,.92);
  color:var(--navy);
}

.admin-action-btn-danger:not(:disabled){
  background:rgba(146,26,36,.18);
  color:#ffb8bf;
}

.upload-preview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(86px,1fr));
  gap:10px;
  margin-top:14px;
}

.gallery-upload-card .upload-preview-grid,
.store-editor-card .upload-preview-grid,
.store-photo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(68px,1fr));
  gap:8px;
  margin-top:0;
}

.store-photo-grid{
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
}

.upload-preview-item{
  border:1px solid rgba(218,202,177,.24);
  border-radius:14px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
}

.gallery-upload-card .upload-preview-item,
.store-editor-card .upload-preview-item{
  border-color:rgba(218,202,177,.16);
  border-radius:13px;
  background:rgba(218,202,177,.07);
}

.upload-preview-item img{
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  object-fit:cover;
}

.upload-preview-name{
  padding:7px 8px;
  font-size:.72rem;
  color:var(--muted);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.gallery-upload-card .upload-preview-name{
  padding:5px 6px;
  font-size:.66rem;
}

.gallery-manager-card{
  display:grid;
  gap:12px;
  border-radius:18px;
  padding:13px;
}

.gallery-upload-card.is-collapsed{
  display:none;
}

/* Opening the uploader (+) calls scrollIntoView, which parks the card top at
   the scrollport top — right under the sticky .topbar. Offset by the topbar
   height (--topbarH tracks desktop 78 / mobile 68) PLUS the iOS safe-area inset
   (the standalone PWA pads .topbar by env(safe-area-inset-top); --topbarH omits
   it, and it's 0 in desktop/browser) so the whole card, starting at Gallery
   Section, clears the bar instead of hiding behind it. */
.gallery-upload-card{
  scroll-margin-top:calc(var(--topbarH) + env(safe-area-inset-top, 0px) + 8px);
}

.gallery-uploader-close-btn{
  min-width:34px;
  width:34px;
  height:34px;
  font-size:1rem;
  line-height:1;
}

.gallery-manager-card h2{
  white-space:nowrap;
}

.gallery-manager-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:0 0 auto;
  flex-wrap:nowrap;
}

.gallery-manager-filter{
  box-sizing:border-box;
  width:auto;
  min-width:146px;
  max-width:190px;
  height:34px;
  min-height:34px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:12px;
  background:#244866;
  color:var(--cream);
  padding:0 32px 0 10px;
  font-size:.82rem;
  font-weight:600;
}

.gallery-manager-list{
  min-height:48px;
}

.gallery-manager-empty{
  margin:0;
  font-size:.88rem;
}

.gallery-manager-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(138px,1fr));
  gap:10px;
}

.gallery-manager-item{
  display:grid;
  gap:7px;
  min-width:0;
  padding:7px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:14px;
  background:rgba(218,202,177,.07);
}

.gallery-manager-item:focus-visible{
  outline:2px solid rgba(10,132,255,.72);
  outline-offset:2px;
}

.gallery-manager-item.is-gallery-hidden{
  opacity:.74;
}

.gallery-manager-thumb{
  position:relative;
  width:100%;
  padding:0;
  border:0;
  border-radius:11px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  cursor:pointer;
}

.gallery-manager-thumb img{
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  object-fit:contain;
  background:rgba(9,47,77,.06);
}

.gallery-manager-meta{
  display:grid;
  gap:4px;
  min-width:0;
}

.gallery-manager-name{
  color:var(--cream);
  font-size:.76rem;
  font-weight:650;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.gallery-manager-subrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  min-width:0;
  color:rgba(218,202,177,.68);
  font-size:.68rem;
}

.gallery-manager-subrow span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.gallery-manager-pill{
  flex:0 0 auto;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(218,202,177,.12);
  color:rgba(218,202,177,.84);
  font-size:.64rem;
  font-weight:700;
}

.gallery-manager-item.is-gallery-hidden .gallery-manager-pill{
  background:rgba(146,26,36,.18);
  color:#ffb8bf;
}

/* Gallery manager photo action select — compact sizing; theme below */
.gallery-manager-action-select{
  width:100%;
  max-width:116px;
  height:28px;
  min-height:28px;
  display:block;
  margin:0 auto;
  padding:0 22px 0 7px;
  border-radius:10px;
  font-size:.8rem;
  font-weight:600;
  line-height:1.2;
}

/* Gloves For Sale photo role select — native select, wide enough for Primary/Hover/Action */
.sale-photo-action-select{
  box-sizing:border-box;
  width:100%;
  min-width:130px;
  max-width:min(150px, 100%);
  height:28px;
  min-height:28px;
  display:block;
  margin:0 auto;
  padding:0 24px 0 8px;
  border-radius:10px;
  font-size:.8rem;
  font-weight:600;
  line-height:1.2;
}

.sale-photo-actions{
  padding:6px;
}

.sale-photo-badges{
  min-height:28px;
  display:flex;
  align-items:center;
  gap:4px;
}

.menu-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.42);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:30;
}

.menu-backdrop.show{
  opacity:1;
  pointer-events:auto;
}

/* =========================
   MAIN LAYOUT
   ========================= */
.main-panel{
  max-width:920px;
  margin:0 auto;
  height:100vh;
  height:100dvh;
  min-height:100vh;
  min-height:100dvh;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  background:var(--bg);
  overflow-anchor:none;
}

/* =========================
   LOGIN
   ========================= */
#loginView{
  min-height:100vh;
  background:
    radial-gradient(circle at top left, rgba(218,202,177,.08), transparent 35%),
    linear-gradient(180deg, #092f4d 0%, #0d3c60 100%);
  padding:16px;
}

#loginView.active{
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

.login-card{
  width:100%;
  max-width:380px;
  margin:52px auto 0;
  background:rgba(218,202,177,.96);
  border:1px solid var(--dark);
  border-radius:22px;
  box-shadow:0 14px 30px rgba(0,0,0,.20);
  padding:16px 15px 13px;
}

.login-card h1{
  margin:0 0 10px;
  font-size:1.35rem;
  line-height:1;
  color:var(--navy);
  letter-spacing:-0.03em;
}

.login-card .muted{
  margin-bottom:12px;
  color:rgba(9,47,77,.82);
  font-size:.88rem;
}

.login-card input{
  width:100%;
  border-radius:20px;
  border:2px solid rgba(9,47,77,.40);
  padding:12px 12px;
  font-size:.92rem;
  text-align:center;
  color:var(--navy);
  background:rgba(9,47,77,.14);
  outline:none;
}

.login-card input + input{
  margin-top:10px;
}

.login-card input::placeholder{
  color:rgba(9,47,77,.62);
  font-size:.92rem;
}

.login-card input:focus{
  border-color:rgba(9,47,77,.28);
  box-shadow:0 0 0 3px rgba(9,47,77,.10);
}

.login-card .status{
  min-height:15px;
  margin-top:9px;
  font-size:.86rem;
}

/* ---- Passcode + Passkey login controls ----
   Shared pill shape on the cream login card. "Log In" (passcode) is the
   primary solid-navy action; "Sign in with Face ID" is the outlined
   secondary and is revealed by JS only where WebAuthn is supported. The
   "Set up Face ID" menu entry inherits .nav-link. */
.passcode-login-btn,
.passkey-login-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  font-size:.92rem;
  font-weight:600;
  cursor:pointer;
  min-height:32px;
  transition:transform .1s ease, background .15s ease;
}

/* Primary: a native filled button — borderless with a soft shadow, clearly
   distinct from the bordered passcode field above it. */
.passcode-login-btn{
  margin-top:14px;
  border:none;
  background:var(--navy);
  color:var(--cream);
  box-shadow:0 1px 2px rgba(9,47,77,.22);
}

.passcode-login-btn:hover{
  background:#0d3c60;
}

/* Secondary: outlined, lighter weight, sits just below the primary. */
.passkey-login-btn{
  margin-top:9px;
  border:1.5px solid rgba(9,47,77,.32);
  background:transparent;
  color:var(--navy);
}

.passcode-login-btn:active,
.passkey-login-btn:active{
  transform:scale(.99);
}

.passkey-login-icon{
  font-size:1.05rem;
  line-height:1;
}

.nav-passkey{
  color:rgba(218,202,177,.92);
}

.passkey-login-btn[hidden],
.nav-passkey[hidden]{
  display:none;
}

/* =========================
   DASHBOARD / ORDERS SHELL
   ========================= */
#homeDashboardView,
#dashboardView{
  min-height:100vh;
  background:var(--bg);
}

.dashboard-panel{
  padding:12px;
}

.dashboard-shell{
  display:grid;
  gap:14px;
  max-width:1080px;
  margin:0 auto;
}

.clubhouse-greeting{
  display:grid;
  gap:4px;
  padding:2px 0 2px;
  min-width:0;
}

.clubhouse-greeting-title{
  margin:0;
  color:var(--navy);
  font-size:1.05rem;
  font-weight:650;
  line-height:1.25;
}

.clubhouse-greeting-sub{
  margin:0;
  font-size:.88rem;
  line-height:1.35;
}

.clubhouse-greeting-date{
  font-weight:550;
  color:rgba(9,47,77,.72);
}

.clubhouse-greeting-sub-sep{
  margin:0 .28em;
  color:rgba(9,47,77,.34);
}

.dashboard-section{
  display:grid;
  gap:8px;
}

.dashboard-section-title{
  margin:0;
  color:var(--navy);
  font-size:.82rem;
  font-weight:600;
  letter-spacing:.04em;
  text-transform:uppercase;
}

/* ---- Collapsible dashboard sections (Shop Metrics / Finance Snapshot) ----
   Reuses the Order Detail chevron pattern, re-tinted for the light dashboard.
   The collapse control is a compact icon button pinned to the far right of the
   heading, so the finance filter sits to its left. Toggling only adds/removes
   .is-collapsed (no re-render), keeping the finance date-input hazard guard. */
.dashboard-section-collapse-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.dashboard-section-collapse-btn{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  padding:0;
  border:0;
  background:none;
  cursor:pointer;
}

.dashboard-section-chevron{
  color:rgba(9,47,77,.5);
  font-size:1.15rem;
  line-height:1;
  transition:transform var(--motion-base, .18s) ease;
}

.dashboard-section-collapsible:not(.is-collapsed) .dashboard-section-chevron{
  transform:rotate(90deg);
}

.dashboard-section-collapsible.is-collapsed .dashboard-section-body{
  display:none;
}

.dashboard-section-body{
  display:grid;
  gap:8px;
}

/* Finance heading: title takes the remaining width so the filter + collapse
   button group to the right, with the collapse chevron pinned last. */
.dashboard-section-finance .dashboard-section-title-group{
  flex:1 1 auto;
}

.dashboard-section-title-group{
  display:grid;
  gap:2px;
  min-width:0;
  text-align:left;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(148px, 1fr));
  gap:8px;
}

.dashboard-grid-finance{
  grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
}

.dashboard-card{
  border:1px solid rgba(9,47,77,.12);
  border-radius:14px;
  background:rgba(255,250,243,.96);
  box-shadow:0 6px 18px rgba(9,47,77,.05);
}

.dashboard-metric{
  display:grid;
  gap:4px;
  padding:11px 12px;
  text-align:left;
}

button.dashboard-metric{
  width:100%;
  cursor:pointer;
  font:inherit;
  color:inherit;
  transition:
    border-color .16s ease,
    background .16s ease,
    transform .12s ease;
}

button.dashboard-metric:hover{
  border-color:rgba(9,47,77,.22);
  background:#fffdf8;
}

button.dashboard-metric:active{
  transform:scale(.99);
}

.dashboard-metric-label{
  color:rgba(9,47,77,.62);
  font-size:.68rem;
  font-weight:600;
  line-height:1.25;
}

.dashboard-metric-value{
  color:var(--navy);
  font-size:1.12rem;
  font-weight:600;
  line-height:1.15;
  letter-spacing:-.01em;
}

.dashboard-metric-sub{
  color:rgba(9,47,77,.56);
  font-size:.66rem;
  line-height:1.3;
}

.dashboard-section-heading-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}

.dashboard-section-kicker{
  flex:0 0 auto;
  color:rgba(9,47,77,.52);
  font-size:.64rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.2;
}

.dashboard-section-kicker-primary{
  color:rgba(9,47,77,.62);
}

.dashboard-section-finance .dashboard-section-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.dashboard-section-finance .dashboard-section-title-wrap{
  display:grid;
  gap:2px;
  min-width:0;
  flex:1 1 auto;
}

.dashboard-section-range{
  margin:0;
  font-size:.68rem;
  line-height:1.25;
}

.dashboard-finance-controls{
  flex:0 0 auto;
  position:relative;
  display:flex;
  justify-content:flex-end;
}

.dashboard-finance-filter-toggle{
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:30px;
  min-height:30px;
  padding:0 10px;
  border:1px solid rgba(9,47,77,.10);
  border-radius:10px;
  background:rgba(9,47,77,.10);
  color:var(--navy);
  font-size:.74rem;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.50);
  user-select:none;
  -webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}

.dashboard-finance-filter-toggle svg{
  width:13px;
  height:13px;
  display:block;
  flex:0 0 auto;
  fill:none;
  stroke:currentColor;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.dashboard-finance-filter-toggle:active,
.dashboard-finance-filter-toggle.is-active{
  background:var(--navy);
  color:#fffaf3;
}

.dashboard-finance-controls .dashboard-finance-filter-popover{
  position:absolute;
  top:calc(100% + 6px);
  left:auto;
  right:0;
  min-width:172px;
}

/* Flip the finance filter popover above the toggle when it would open past
   the bottom of the viewport (Finance Snapshot lives at the bottom of the
   Clubhouse). The .open-up class is toggled in setFinanceFilterMenuOpen. */
.dashboard-finance-controls .dashboard-finance-filter-popover.open-up{
  top:auto;
  bottom:calc(100% + 6px);
}

.dashboard-finance-custom{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.dashboard-finance-custom label{
  display:grid;
  gap:4px;
  color:rgba(9,47,77,.62);
  font-size:.68rem;
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.dashboard-finance-custom input[type="date"]{
  box-sizing:border-box;
  width:100%;
  min-height:34px;
  padding:6px 10px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:12px;
  background:#fffaf3;
  color:var(--navy);
  font-size:.82rem;
  font-weight:500;
}

.dashboard-bench-card,
.dashboard-attention-card{
  padding:8px;
}

.dashboard-bench-card--primary{
  border-color:rgba(9,47,77,.18);
  border-left:3px solid var(--navy);
  box-shadow:0 8px 22px rgba(9,47,77,.08);
}

.dashboard-bench-card--secondary{
  border-color:rgba(9,47,77,.10);
  background:rgba(9,47,77,.03);
  box-shadow:none;
}

.dashboard-bench-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 6px;
  border-top:1px solid rgba(9,47,77,.08);
}

.dashboard-bench-row:first-child{
  border-top:none;
}

.dashboard-bench-main{
  min-width:0;
  flex:1 1 auto;
}

.dashboard-bench-title{
  color:var(--navy);
  font-size:.88rem;
  font-weight:600;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.dashboard-bench-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  margin-top:3px;
  color:rgba(9,47,77,.58);
  font-size:.72rem;
  line-height:1.3;
}

.dashboard-attention-item{
  display:block;
  width:100%;
  border:0;
  border-top:1px solid rgba(9,47,77,.08);
  background:transparent;
  color:var(--navy);
  padding:10px 8px;
  text-align:left;
  font:inherit;
  font-size:.82rem;
  line-height:1.35;
  cursor:pointer;
}

.dashboard-attention-item:first-child{
  border-top:none;
}

.dashboard-attention-item:hover{
  background:rgba(9,47,77,.04);
}

.dashboard-empty{
  margin:0;
  padding:8px 6px;
  font-size:.82rem;
  line-height:1.35;
}

.topbar{
  position:sticky;
  top:0;
  z-index:25;
  background:var(--navy);
  color:var(--cream);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px 14px 12px;
  border-bottom:1px solid rgba(218,202,177,.18);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  flex:1 1 auto;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  position:relative;
}

.topbar-icon-action{
  min-width:44px;
  height:44px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.topbar-icon-action svg{
  width:20px;
  height:20px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.topbar-icon-action[hidden]{
  display:none;
}

.inventory-filter-toggle,
.order-filter-toggle{
  position:relative;
}

.inventory-filter-toggle.is-active,
.order-filter-toggle.is-active{
  background:rgba(218,202,177,.92);
  color:var(--navy);
}

.inventory-filter-toggle.has-active-filter::after,
.order-filter-toggle.has-active-filter::after{
  content:"";
  position:absolute;
  top:8px;
  right:8px;
  width:7px;
  height:7px;
  border-radius:999px;
  background:#0a84ff;
  box-shadow:none;
}

.admin-filter-popover{
  position:fixed;
  left:0;
  top:0;
  right:auto;
  z-index:var(--admin-z-popover);
  min-width:196px;
  padding:7px;
  border-radius:18px;
  background:rgba(19,41,61,.96);
  border:1px solid rgba(218,202,177,.16);
  box-shadow:0 18px 42px rgba(0,0,0,.26);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}

.admin-filter-popover[hidden]{
  display:none;
}

.admin-customer-autocomplete{
  display:grid;
  gap:4px;
  margin-top:6px;
  padding:6px;
  max-height:246px;
  overflow:auto;
  border-radius:16px;
  background:rgba(19,41,61,.98);
  border:1px solid rgba(218,202,177,.18);
  box-shadow:0 14px 34px rgba(0,0,0,.24);
  z-index:var(--admin-z-popover);
  -webkit-overflow-scrolling:touch;
}

.admin-customer-autocomplete[hidden]{
  display:none;
}

.admin-customer-suggestion{
  width:100%;
  display:grid;
  gap:3px;
  min-height:44px;
  padding:8px 10px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:var(--cream);
  text-align:left;
}

.admin-customer-suggestion:hover,
.admin-customer-suggestion:focus-visible,
.admin-customer-suggestion.is-active{
  background:rgba(218,202,177,.12);
}

.admin-customer-suggestion-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.admin-customer-suggestion-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.88rem;
  font-weight:700;
}

.admin-customer-suggestion-meta,
.admin-customer-suggestion-sub{
  color:rgba(218,202,177,.66);
  font-size:.76rem;
  font-weight:600;
  line-height:1.2;
}

.admin-customer-suggestion-meta{
  flex:0 0 auto;
}

.admin-customer-suggestion-sub{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.admin-customer-clear{
  width:auto;
  margin-top:6px;
  min-height:30px;
  padding:0;
  border:0;
  background:transparent;
  color:rgba(218,202,177,.66);
  font-size:.78rem;
  font-weight:700;
  text-align:left;
}

.admin-customer-clear:hover,
.admin-customer-clear:focus-visible{
  color:var(--cream);
  text-decoration:underline;
  text-underline-offset:3px;
}

.order-filter-popover{
  width:min(310px, calc(100vw - 24px));
  max-height:min(70vh, 430px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}

.admin-filter-list{
  display:grid;
  gap:4px;
}

.admin-filter-list button{
  width:100%;
  border:0;
  border-radius:12px;
  min-height:34px;
  padding:8px 10px;
  background:transparent;
  color:rgba(218,202,177,.78);
  font-size:.82rem;
  font-weight:600;
  line-height:1.15;
  text-align:left;
  white-space:nowrap;
}

.admin-filter-list button.active{
  background:rgba(218,202,177,.92);
  color:var(--navy);
  box-shadow:none;
}

.topbar h1,
#viewTitle{
  margin:0;
  font-size:1.55rem;
  line-height:1;
  color:var(--cream);
}

.topbar .topbar-subtitle{
  margin:4px 0 0;
  min-height:1.35em;
  color:rgba(218,202,177,.76);
  font-size:.95rem;
  line-height:1.35;
}

.toolbar{
  padding:8px 14px 10px;
  background:var(--bg);
  border-bottom:1px solid var(--line);
}

.search-toolbar{
  display:block;
  position:sticky;
  top:var(--topbarH);
  z-index:24;
  background:rgba(9,47,77,.98);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
}

.search-toolbar.is-collapsed{
  display:none;
}

.search-control{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:10px;
  align-items:center;
}

.search-field-shell{
  min-width:0;
  height:38px;
  display:grid;
  grid-template-columns:18px minmax(0, 1fr) auto;
  align-items:center;
  gap:7px;
  padding:0 7px 0 12px;
  border:1px solid rgba(218,202,177,.13);
  border-radius:999px;
  background:rgba(244,238,228,.13);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  transition:
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.search-field-shell:focus-within{
  background:rgba(244,238,228,.18);
  border-color:rgba(218,202,177,.22);
  box-shadow:0 0 0 3px rgba(218,202,177,.07);
}

.search-field-icon{
  width:17px;
  height:17px;
  display:block;
  fill:none;
  stroke:rgba(218,202,177,.66);
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.search-field-shell input{
  width:100%;
  height:100%;
  min-width:0;
  background:transparent;
  color:var(--cream);
  border:0;
  border-radius:0;
  padding:0;
  appearance:none;
  -webkit-appearance:none;
}

.search-field-shell input:focus-visible{
  outline:none;
}

.search-field-shell input::-webkit-search-decoration,
.search-field-shell input::-webkit-search-cancel-button{
  -webkit-appearance:none;
}

.search-field-shell input::placeholder{
  color:rgba(218,202,177,.62);
}

.search-clear-btn,
.search-close-btn{
  border:0;
  color:var(--cream);
  font-weight:600;
}

.search-clear-btn[hidden]{
  display:none;
}

.search-clear-btn{
  width:24px;
  height:24px;
  min-width:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(218,202,177,.72);
  color:var(--navy);
  padding:0 0 2px;
  font-size:1rem;
  line-height:1;
}

.search-close-btn{
  min-height:38px;
  padding:0 2px;
  background:transparent;
  font-size:.9rem;
  color:rgba(218,202,177,.94);
}

.pull-refresh-indicator{
  position:fixed;
  left:50%;
  top:70px;
  z-index:24;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(19,41,61,.94);
  color:var(--cream);
  border:1px solid rgba(218,202,177,.18);
  box-shadow:0 10px 24px rgba(0,0,0,.20);
  opacity:0;
  pointer-events:none;
  transform:translate(-50%, 0);
  transition:
    opacity .14s ease,
    transform .18s cubic-bezier(0.22, 1, 0.36, 1);
  font-size:.82rem;
  font-weight:600;
}

.pull-refresh-indicator.visible{
  opacity:1;
}

.pull-refresh-indicator.ready{
  background:rgba(36,72,102,.96);
}

.pull-refresh-spinner{
  width:14px;
  height:14px;
  border-radius:999px;
  border:2px solid rgba(218,202,177,.28);
  border-top-color:var(--cream);
}

.pull-refresh-indicator.refreshing .pull-refresh-spinner{
  animation:pullRefreshSpin .7s linear infinite;
}

@keyframes pullRefreshSpin{
  to{ transform:rotate(360deg); }
}

/* =========================
   ORDERS LIST
   ========================= */
.orders-list{
  display:block;
  overflow-anchor:none;
}

.inventory-card{
  display:grid;
  gap:8px;
  padding:12px 14px;
  background:var(--panel);
  border-bottom:1px solid rgba(218,202,177,.14);
  color:var(--cream);
  cursor:pointer;
  touch-action:pan-y;
  -webkit-tap-highlight-color:transparent;
}

.inventory-card:focus-visible{
  outline:2px solid rgba(122,174,218,.75);
  outline-offset:-2px;
}

.inventory-card-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:12px;
  min-width:0;
}

.inventory-card-row-meta{
  color:rgba(218,202,177,.72);
  font-size:.92rem;
  line-height:1.1;
}

.inventory-color{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}

.inventory-swatch{
  width:14px;
  height:14px;
  flex:0 0 14px;
  border-radius:999px;
  border:1px solid rgba(9,47,77,.18);
  box-shadow:none;
  background:var(--cream);
}

.inventory-swatch-custom{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, #dacab1, #78aeda 48%, #b01f2e);
  color:var(--navy);
  font-size:.56rem;
  font-weight:600;
}

.inventory-color-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--cream);
  font-size:1rem;
  font-weight:600;
  letter-spacing:-.015em;
}

.inventory-status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:.78rem;
  font-weight:600;
  line-height:1;
  background:rgba(62,155,99,.16);
  color:#65c184;
  border:1px solid rgba(101,193,132,.18);
}

.inventory-status-low .inventory-status-pill{
  background:rgba(214,178,31,.16);
  color:#e8c848;
  border-color:rgba(232,200,72,.20);
}

.inventory-status-out .inventory-status-pill{
  background:rgba(146,26,36,.20);
  color:#ff6b78;
  border-color:rgba(255,107,120,.22);
}

.inventory-status-ignore .inventory-status-pill{
  background:rgba(218,202,177,.10);
  color:rgba(218,202,177,.72);
  border-color:rgba(218,202,177,.16);
}

.inventory-qty{
  display:flex;
  align-items:baseline;
  gap:5px;
  min-width:0;
}

.inventory-qty strong{
  color:rgba(218,202,177,.92);
  font-size:1rem;
  line-height:1;
}

.inventory-qty span,
.inventory-reorder{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.inventory-reorder{
  text-align:right;
  color:rgba(218,202,177,.58);
}

.order-card{
  background:var(--panel);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:14px;
}

.clickable-card{
  cursor:pointer;
}

.order-top{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:12px;
  align-items:start;
}

.order-main{
  min-width:0;
}

.order-name{
  font-size:1.02rem;
  font-weight:600;
  color:var(--cream);
  margin:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.order-number{
  font-size:1.05rem;
  font-weight:600;
  letter-spacing:.04em;
  margin-top:0;
}

.order-number.paid{ color:var(--green); }
.order-number.unpaid{ color:var(--red); }

.order-status{
  text-align:right;
  color:var(--cream);
  font-size:.95rem;
  font-weight:600;
  white-space:nowrap;
}

.order-actions-wrap{
  display:none;
}

.order-subrow{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:10px;
  align-items:center;
  margin-top:8px;
}

.order-meta-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.workflow-progress{
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:flex-end;
}

.workflow-meter{
  display:flex;
  align-items:center;
  gap:4px;
}

.workflow-step,
.workflow-connector{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.workflow-step{
  width:8px;
  height:8px;
  border-radius:999px;
  background:rgba(255,255,255,.24);
}

.workflow-step.complete{
  background:rgba(255,255,255,.7);
}

.workflow-step.active{
  background:var(--cream);
}

.workflow-connector{
  width:12px;
  height:2px;
  background:rgba(255,255,255,.20);
}

.workflow-connector.complete{
  background:rgba(255,255,255,.6);
}

.no-results{
  padding:20px 16px;
  color:var(--muted);
}

/* =========================
   STORE / GLOVES FOR SALE
   ========================= */
.sale-add-btn{
  width:auto;
  min-width:0;
  min-height:40px;
  border-radius:13px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  font-size:.86rem;
  line-height:1;
  font-weight:600;
  white-space:nowrap;
}

.inventory-add-btn{
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  border-radius:14px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
  font-size:1.35rem;
  line-height:1;
  font-weight:600;
}

.sale-gloves-list{
  display:grid;
  border-top:1px solid var(--line);
}

.sale-glove-row{
  width:100%;
  border:0;
  border-bottom:1px solid var(--line);
  background:rgba(19,41,61,.98);
  color:var(--cream);
  padding:12px 14px;
  display:grid;
  gap:8px;
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.sale-glove-row:active{
  background:rgba(36,72,102,.70);
}

.sale-glove-row-main,
.sale-glove-row-meta{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:12px;
  min-width:0;
}

.sale-glove-title{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:1rem;
  font-weight:600;
  line-height:1.1;
  letter-spacing:-.015em;
}

.sale-glove-price{
  color:rgba(218,202,177,.82);
  font-size:.94rem;
  font-weight:600;
  line-height:1;
}

.sale-glove-meta{
  min-width:0;
  max-width:45vw;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:rgba(218,202,177,.62);
  font-size:.82rem;
  font-weight:500;
  line-height:1;
  text-align:right;
}

.sale-status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:0 9px;
  border-radius:999px;
  font-size:.72rem;
  font-weight:600;
  line-height:1;
  white-space:nowrap;
}

.sale-status-available{
  background:rgba(62,155,99,.16);
  color:#65c184;
  border:1px solid rgba(101,193,132,.18);
}

.sale-status-sold{
  background:rgba(146,26,36,.20);
  color:#ff6b78;
  border:1px solid rgba(255,107,120,.22);
}

.sale-status-draft{
  background:rgba(218,202,177,.10);
  color:rgba(218,202,177,.72);
  border:1px solid rgba(218,202,177,.16);
}

.store-empty-state{
  display:grid;
  gap:6px;
  align-content:start;
  margin:12px;
  padding:14px;
  border:1px solid rgba(218,202,177,.14);
  border-radius:18px;
  background:rgba(19,41,61,.88);
  color:var(--muted);
  font-size:.9rem;
  line-height:1.35;
}

.store-empty-state strong{
  color:var(--cream);
  font-size:1rem;
}

.store-empty-add{
  justify-self:start;
  min-height:36px;
  margin-top:4px;
  border-radius:12px;
  padding:0 12px;
  font-weight:600;
}

.store-editor-panel{
  padding:12px;
}

.store-editor-card{
  display:grid;
  gap:14px;
  padding:13px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:18px;
  background:rgba(19,41,61,.96);
}

.store-editor-header h2,
.store-photo-header h3{
  margin:0 0 4px;
  color:var(--cream);
  font-size:1.05rem;
  line-height:1.15;
  letter-spacing:-.015em;
}

.store-editor-header .muted,
.store-photo-header .muted{
  margin:0;
  font-size:.82rem;
  line-height:1.35;
}

.store-editor-card .detail-grid{
  gap:10px;
}

.store-editor-card .label{
  display:block;
  margin:0 0 5px;
  color:rgba(218,202,177,.72);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.store-editor-card .detail-block input,
.store-editor-card .detail-block select,
.store-editor-card .detail-block textarea{
  min-height:40px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:14px;
  background:#244866;
  color:var(--cream);
  padding:8px 11px;
  font-size:.92rem;
  font-weight:500;
}

.store-editor-card .detail-block textarea{
  min-height:72px;
  line-height:1.35;
}

.store-editor-card .detail-block input::placeholder,
.store-editor-card .detail-block textarea::placeholder{
  color:rgba(218,202,177,.45);
}

.store-editor-card .detail-block select{
  appearance:none;
  -webkit-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(218,202,177,.9) 50%),
    linear-gradient(135deg, rgba(218,202,177,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 10px) 17px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:34px;
}

.store-photo-section{
  display:grid;
  gap:10px;
  padding-top:12px;
  border-top:1px solid rgba(218,202,177,.14);
}

.store-editor-card .upload-preview-name:not(.sale-photo-badges){
  display:none;
}

#saleGlovePhotosList{
  display:grid;
  gap:8px;
}

.sale-photo-item{
  display:grid;
  grid-template-rows:auto minmax(20px, auto) auto;
}

.sale-photo-badges{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:5px 5px 0;
}

.sale-photo-badges span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:18px;
  padding:0 6px;
  border-radius:999px;
  background:rgba(218,202,177,.14);
  color:rgba(218,202,177,.90);
  font-size:.58rem;
  font-weight:600;
  line-height:1;
}

.sale-photo-actions{
  padding:6px;
}

.store-editor-actions{
  padding-top:2px;
}

.store-save-btn{
  background:rgba(218,202,177,.92) !important;
  color:var(--navy) !important;
}

.store-delete-btn{
  background:rgba(146,26,36,.20) !important;
  color:#ffb8bf !important;
}

/* =========================
   MAP VIEW
   ========================= */
.map-panel{
  padding:12px 12px calc(18px + env(safe-area-inset-bottom));
}

.map-card{
  width:100%;
  max-width:1040px;
  margin:0 auto;
  display:grid;
  gap:10px;
  background:rgba(19,41,61,.96);
  border:1px solid rgba(218,202,177,.15);
  border-radius:18px;
  padding:12px;
}

.map-status-warning{
  display:inline-flex;
  align-items:center;
  width:auto;
  max-width:100%;
  min-height:26px;
  padding:4px 9px;
  border-radius:999px;
  background:rgba(214,178,31,.13);
  color:#e8c848;
  border:1px solid rgba(232,200,72,.18);
  font-size:.78rem;
  font-weight:600;
}

.order-map{
  position:relative;
  isolation:isolate;
  z-index:0;
  width:100%;
  height:calc(100dvh - var(--topbarH) - 124px);
  min-height:430px;
  border-radius:16px;
  overflow:hidden;
  background:#10263a;
  border:1px solid rgba(218,202,177,.18);
}

.map-unmapped-list{
  display:grid;
  gap:10px;
  margin:0 0 14px;
}

.map-unmapped-list[hidden]{
  display:none;
}

.map-unmapped-title{
  color:var(--cream);
  font-weight:600;
}

.map-unmapped-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  border:1px solid rgba(218,202,177,.14);
  border-radius:10px;
  background:rgba(255,255,255,.045);
}

.map-unmapped-main{
  display:grid;
  gap:4px;
  min-width:0;
  color:var(--muted);
  font-size:.9rem;
}

.map-unmapped-main strong{
  color:var(--cream);
}

.map-unmapped-address,
.map-unmapped-reason{
  overflow-wrap:anywhere;
}

.map-unmapped-reason{
  color:#c99090;
}

.map-unmapped-btn{
  flex:0 0 auto;
  border:none;
  border-radius:12px;
  background:rgba(218,202,177,.92);
  color:var(--navy);
  min-height:36px;
  padding:0 13px;
  font:inherit;
  font-size:.82rem;
  font-weight:600;
  cursor:pointer;
}

.order-map .leaflet-control-zoom{
  border:0;
  border-radius:14px;
  overflow:hidden;
  background:rgba(255,250,243,.92);
  box-shadow:0 8px 20px rgba(0,0,0,.18);
}

.order-map .leaflet-control-zoom a{
  width:36px;
  height:36px;
  border:0;
  border-bottom:1px solid rgba(9,47,77,.12);
  background:transparent;
  color:var(--navy);
  font:600 1.25rem/36px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.order-map .leaflet-control-zoom a:last-child{
  border-bottom:0;
}

.order-map .leaflet-control-zoom a:hover,
.order-map .leaflet-control-zoom a:focus{
  background:rgba(9,47,77,.08);
  color:var(--navy);
}

.order-map .leaflet-control-attribution{
  margin:0 6px 6px 0;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(255,250,243,.82);
  color:rgba(9,47,77,.70);
  font-size:.62rem;
  line-height:1.2;
  box-shadow:0 4px 12px rgba(0,0,0,.10);
}

.order-map .leaflet-control-attribution a{
  color:rgba(9,47,77,.82);
}

.order-map .leaflet-popup-content-wrapper{
  border-radius:16px;
  background:rgba(255,250,243,.96);
  color:var(--navy);
  box-shadow:0 14px 34px rgba(0,0,0,.22);
}

.order-map .leaflet-popup-tip{
  background:rgba(255,250,243,.96);
}

.order-map .leaflet-popup-close-button{
  width:28px;
  height:28px;
  border-radius:999px;
  margin:6px 6px 0 0;
  color:rgba(9,47,77,.58);
  font-size:18px;
  line-height:27px;
}

.order-map .leaflet-popup-close-button:hover,
.order-map .leaflet-popup-close-button:focus{
  background:rgba(9,47,77,.08);
  color:var(--navy);
}

.map-popup{
  display:grid;
  gap:8px;
  width:min(230px, 70vw);
  color:var(--navy);
  font-family:-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.map-popup-head{
  min-width:0;
}

.map-popup-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:600;
  font-size:.92rem;
  line-height:1.15;
}

.map-popup-meta,
.map-popup-location{
  font-size:.76rem;
  line-height:1.35;
  color:rgba(9,47,77,.68);
}

.map-popup-meta{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.map-popup-status{
  font-weight:600;
  color:rgba(9,47,77,.82);
  white-space:nowrap;
}

.map-popup-status-on-hold{
  color:var(--red);
}

.map-popup-approximate{
  font-size:.72rem;
  line-height:1.35;
  color:rgba(9,47,77,.56);
}

.map-popup-btn{
  border:none;
  background:transparent;
  color:#0a66c2;
  padding:2px 0 0;
  font:inherit;
  font-size:.78rem;
  font-weight:600;
  cursor:pointer;
  text-align:left;
  justify-self:start;
  line-height:1.25;
}

.leaflet-container{
  font:inherit;
}

.leaflet-popup-content{
  margin:16px 36px 12px 14px;
}

.lace-dot-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-right:0;
  min-width:0;
}

.admin-menu-layer{
  position:fixed;
  inset:0;
  z-index:var(--admin-z-menu);
  pointer-events:none;
}

.workflow-sheet-root{
  position:fixed;
  inset:0;
  z-index:0;
  display:none;
  pointer-events:none;
}

.workflow-sheet-root.open{
  display:block;
}

.workflow-backdrop{
  position:fixed;
  inset:0;
  background:transparent;
  pointer-events:auto;
}

/* Admin menu/form widths:
   - action menu: fit-content between --admin-menu-min-width and --admin-menu-max-width
   - compact confirm: text + Save/Cancel, capped by --admin-form-compact-max
   - simple input form: 1-2 fields, capped by --admin-form-small-max
   - larger edit/add form: multiple fields, capped by --admin-form-large-max
   - mobile: same tokens, clamped to viewport in coarse-pointer block below */
.workflow-sheet{
  position:fixed;
  left:0;
  top:0;
  width:fit-content;
  min-width:var(--admin-menu-min-width);
  max-width:min(var(--admin-menu-max-width), calc(100vw - 24px));
  max-height:calc(100vh - 24px);
  padding:6px;
  color:rgba(255,255,255,.92);
  background:rgba(38,38,40,.72);
  border:1px solid rgba(255,255,255,.16);
  border-radius:13px;
  box-shadow:
    0 18px 46px rgba(0,0,0,.34),
    0 2px 8px rgba(0,0,0,.20);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  overflow-y:auto;
  pointer-events:auto;
  transform-origin:top left;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}

.workflow-sheet-root.workflow-action-selected .workflow-sheet{
  width:fit-content;
  min-width:0;
  max-width:min(var(--admin-form-small-max), calc(100vw - 24px));
}

.workflow-sheet-root.workflow-action-selected.workflow-form-compact .workflow-sheet{
  max-width:min(var(--admin-form-compact-max), calc(100vw - 24px));
}

.workflow-sheet-root.workflow-action-selected.workflow-form-small .workflow-sheet{
  max-width:min(var(--admin-form-small-max), calc(100vw - 24px));
}

.workflow-sheet-root.workflow-action-selected.workflow-form-large .workflow-sheet{
  max-width:min(var(--admin-form-large-max), calc(100vw - 24px));
}

@media (hover:hover) and (pointer:fine){
  .workflow-sheet{
    overflow:visible;
  }

  .workflow-sheet-root.workflow-action-selected .workflow-sheet:has(.workflow-sheet-form.is-submenu){
    width:fit-content;
    min-width:var(--admin-menu-min-width);
    max-width:min(var(--admin-menu-max-width), calc(100vw - 24px));
  }

  .workflow-sheet-form.is-submenu:not(:empty){
    position:absolute;
    width:max-content;
    inline-size:max-content;
    min-width:0;
    max-width:calc(100vw - 32px);
    margin:0;
    box-sizing:border-box;
  }

  .workflow-sheet-form.is-submenu.workflow-submenu--confirm{
    max-width:min(240px, calc(100vw - 32px));
  }

  .workflow-sheet-form.is-submenu.workflow-submenu--form{
    width:230px;
    inline-size:230px;
    max-width:min(250px, calc(100vw - 32px));
  }

  .workflow-sheet-root.workflow-form-small .workflow-sheet-form.is-submenu.workflow-submenu--form,
  .workflow-sheet-root.workflow-form-large .workflow-sheet-form.is-submenu.workflow-submenu--form{
    width:230px;
    inline-size:230px;
    max-width:min(250px, calc(100vw - 32px));
  }

  .workflow-sheet-form.is-submenu.workflow-submenu--confirm .workflow-form-content,
  .workflow-sheet-form.is-submenu.workflow-submenu--confirm .workflow-action-form{
    width:max-content;
    inline-size:max-content;
    min-width:0;
    max-width:100%;
  }

  .workflow-sheet-form.is-submenu.workflow-submenu--form .workflow-form-content,
  .workflow-sheet-form.is-submenu.workflow-submenu--form .workflow-action-form{
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .workflow-sheet-form.is-submenu .workflow-action-form input:not([type="checkbox"]),
  .workflow-sheet-form.is-submenu .workflow-action-form textarea,
  .workflow-sheet-form.is-submenu .workflow-action-form select{
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .workflow-sheet-form.is-submenu .workflow-form-actions{
    width:fit-content;
    max-width:100%;
  }
}

.workflow-sheet-header{
  display:grid;
  gap:2px;
  padding:7px 10px 8px;
  margin:0 0 5px;
  border-bottom:1px solid rgba(255,255,255,.13);
}

.workflow-sheet-header div{
  min-width:0;
}

.workflow-customer-name{
  font-size:.78rem;
  font-weight:600;
  color:rgba(255,255,255,.92);
  line-height:1.2;
  white-space:nowrap;
}

.workflow-order-number,
.workflow-current-status{
  font-size:.72rem;
  color:rgba(255,255,255,.58);
  line-height:1.2;
  margin-top:1px;
  white-space:nowrap;
}

.workflow-close-btn{
  display:none;
}

.workflow-section{
  margin:0;
}

.workflow-sheet-title{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}

.workflow-action-list{
  display:grid;
  gap:2px;
}

.workflow-action-btn{
  width:100%;
  border:none;
  background:transparent;
  color:rgba(255,255,255,.92);
  min-height:30px;
  padding:5px 8px 5px 10px;
  border-radius:7px;
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  white-space:nowrap;
  display:grid;
  grid-template-columns:minmax(max-content, 1fr) auto;
  align-items:center;
  gap:18px;
  font-size:.86rem;
  line-height:1.15;
}

.workflow-action-btn[hidden]{
  display:none !important;
}

@media (hover:none), (pointer:coarse){
  .workflow-sheet-root.workflow-action-selected .workflow-action-btn:not(.active){
    display:none !important;
  }
}

.workflow-action-btn.active{
  background:rgba(0,122,255,.92);
  color:#fff;
}

.workflow-menu-chevron{
  color:currentColor;
  opacity:.72;
  font-size:1.1em;
  line-height:1;
}

@media (hover:hover) and (pointer:fine){
  .workflow-action-btn:hover{
    background:rgba(0,122,255,.92);
    color:#fff;
  }

  .workflow-action-btn.active:hover{
    background:rgba(0,122,255,.92);
  }
}

@media (prefers-color-scheme: light){
  .workflow-sheet{
    color:var(--light-ink);
    background:rgba(255,250,243,.94);
    border-color:rgba(9,47,77,.16);
    box-shadow:
      0 18px 46px rgba(0,0,0,.18),
      0 2px 8px rgba(0,0,0,.12);
  }

  .workflow-sheet-header,
  .workflow-sheet-form{
    border-color:rgba(9,47,77,.13);
  }

  .workflow-sheet-form.is-submenu{
    color:var(--light-ink);
    background:rgba(255,250,243,.94);
    border-color:rgba(9,47,77,.16);
    box-shadow:
      0 18px 46px rgba(0,0,0,.18),
      0 2px 8px rgba(0,0,0,.12);
  }

  .workflow-customer-name,
  .workflow-action-btn{
    color:var(--light-ink);
  }

  .workflow-order-number,
  .workflow-current-status,
  .workflow-action-form label,
  .workflow-action-form p{
    color:rgba(9,47,77,.72);
  }

  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    background:#fff;
    border-color:rgba(9,47,77,.18);
    color:var(--light-ink);
  }

  .workflow-action-form input::placeholder,
  .workflow-action-form textarea::placeholder{
    color:rgba(9,47,77,.45);
  }

  .workflow-action-btn.active,
  .workflow-action-btn.active:hover{
    background:#0a84ff;
    color:#fff;
  }

  .workflow-form-actions .workflow-form-cancel{
    background:rgba(9,47,77,.10);
    color:var(--light-ink);
  }

  .workflow-form-actions .workflow-form-submit{
    background:#0a84ff;
    color:#fff;
  }

  .workflow-form-message{
    color:var(--red);
    background:rgba(146,26,36,.08);
    border:1px solid rgba(146,26,36,.18);
  }
}

.workflow-sheet-form{
  display:grid;
  gap:8px;
  margin-top:5px;
  padding:0;
  border-top:1px solid rgba(255,255,255,.13);
}

.workflow-sheet-form:not(:empty){
  padding:8px;
  min-width:0;
  width:100%;
  box-sizing:border-box;
}

.workflow-sheet-form.is-submenu{
  position:absolute;
  z-index:var(--admin-z-submenu);
  width:fit-content;
  min-width:0;
  max-width:min(var(--admin-submenu-max), calc(100vw - 24px));
  max-height:calc(100vh - 24px);
  margin:0;
  padding:8px;
  color:rgba(255,255,255,.92);
  background:rgba(38,38,40,.72);
  border:1px solid rgba(255,255,255,.16);
  border-radius:13px;
  box-shadow:
    0 18px 46px rgba(0,0,0,.34),
    0 2px 8px rgba(0,0,0,.20);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  overflow-y:auto;
  pointer-events:auto;
}

.workflow-sheet-root.workflow-form-compact .workflow-sheet-form.is-submenu{
  max-width:min(var(--admin-form-compact-max), calc(100vw - 24px));
}

.workflow-sheet-root.workflow-form-small .workflow-sheet-form.is-submenu{
  max-width:min(var(--admin-form-small-max), calc(100vw - 24px));
}

.workflow-sheet-root.workflow-form-large .workflow-sheet-form.is-submenu{
  max-width:min(var(--admin-form-large-max), calc(100vw - 24px));
}

.workflow-sheet-form.is-submenu .workflow-action-form p{
  white-space:normal;
}

.workflow-action-form .workflow-form-helper{
  margin:2px 0 0;
  color:rgba(9,47,77,.58) !important;
  font-size:.74rem;
  line-height:1.3;
  white-space:normal;
  overflow-wrap:anywhere;
}

.workflow-form-content{
  display:grid;
  gap:10px;
  min-width:0;
  width:100%;
  max-width:100%;
}

.workflow-action-form{
  min-width:0;
  width:100%;
}

.workflow-action-form label,
.workflow-action-form p{
  display:block;
  margin:0 0 6px;
  color:rgba(255,255,255,.72);
  font-size:.78rem;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.workflow-action-form input + label,
.workflow-action-form textarea + label,
.workflow-action-form select + label{
  margin-top:14px;
}

.workflow-action-form input:not([type="checkbox"]),
.workflow-action-form textarea,
.workflow-action-form select{
  display:block;
  width:100%;
  max-width:100%;
  min-width:min(100%, 9.5rem);
  min-height:34px;
  padding:7px 9px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.12);
  color:#fff;
  line-height:1.2;
  -webkit-appearance:none;
  appearance:none;
  user-select:text;
  -webkit-user-select:text;
  -webkit-touch-callout:default;
}

.inventory-form-title{
  color:rgba(255,255,255,.92) !important;
  font-weight:600;
  font-size:.82rem;
  white-space:normal;
  overflow-wrap:anywhere;
}

.inventory-check-row{
  display:flex !important;
  align-items:center;
  gap:8px;
  margin:2px 0 0 !important;
  color:rgba(255,255,255,.82) !important;
  white-space:normal !important;
}

.workflow-action-form .inventory-check-row input[type="checkbox"]{
  display:inline-block;
  flex:0 0 auto;
  width:18px;
  min-width:18px;
  max-width:18px;
  height:18px;
  min-height:18px;
  margin:0;
  padding:0;
  border:none;
  border-radius:4px;
  background:transparent;
  box-shadow:none;
  accent-color:#0a84ff;
  appearance:auto;
  -webkit-appearance:checkbox;
  vertical-align:middle;
  line-height:normal;
}

.workflow-action-btn.danger{
  color:#ffb3b3;
}

.workflow-form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-start;
  align-self:flex-start;
  width:fit-content;
  max-width:100%;
  margin-top:2px;
}

.workflow-form-actions button{
  flex:0 0 auto;
  border:none;
  border-radius:8px;
  min-width:58px;
  min-height:32px;
  padding:7px 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1.2;
  font-size:.82rem;
}

.workflow-form-actions .workflow-form-cancel{
  background:rgba(255,255,255,.14);
  color:#fff;
}

.workflow-form-actions .workflow-form-submit{
  background:rgba(0,122,255,.92);
  color:#fff;
}

.workflow-form-message{
  color:#ffb3b3;
  font-size:.9rem;
  margin-bottom:10px;
  border-radius:8px;
  padding:8px 10px;
}

@media (prefers-color-scheme: light){
  .workflow-action-form label,
  .workflow-action-form p{
    color:rgba(9,47,77,.72);
  }

  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    background:#fff;
    border-color:rgba(9,47,77,.18);
    color:var(--light-ink);
  }

  .inventory-form-title,
  .inventory-check-row{
    color:var(--light-ink) !important;
  }

  .workflow-action-form .inventory-check-row input[type="checkbox"]{
    accent-color:#0a84ff;
  }

  .workflow-action-btn.danger{
    color:var(--red);
  }

  .workflow-form-actions .workflow-form-cancel{
    background:rgba(9,47,77,.10);
    color:var(--light-ink);
  }

  .workflow-form-actions .workflow-form-submit{
    background:#0a84ff;
    color:#fff;
  }

  .workflow-form-message{
    color:var(--red);
    background:rgba(146,26,36,.08);
    border:1px solid rgba(146,26,36,.18);
  }
}

@media (pointer: coarse){
  :root{
    --admin-menu-min-width:188px;
    --admin-menu-max-width:240px;
    --admin-form-compact-max:min(220px, calc(100vw - 48px));
    --admin-form-small-max:min(280px, calc(100vw - 48px));
    --admin-form-large-max:min(320px, calc(100vw - 48px));
    --admin-submenu-max:min(280px, calc(100vw - 48px));
  }

  .workflow-sheet{
    min-width:var(--admin-menu-min-width);
    max-width:var(--admin-menu-max-width);
    border-radius:16px;
    padding:7px;
    background:rgba(32,32,34,.76);
    box-shadow:
      0 20px 54px rgba(0,0,0,.38),
      0 3px 12px rgba(0,0,0,.20);
  }

  .workflow-sheet-header{
    padding:9px 11px 10px;
  }

  .workflow-customer-name{
    font-size:.9rem;
  }

  .workflow-order-number,
  .workflow-current-status{
    font-size:.78rem;
  }

  .workflow-action-btn{
    min-height:46px;
    padding:11px 10px 11px 13px;
    border-radius:10px;
    font-size:1rem;
    gap:24px;
  }

  .workflow-form-content{
    min-width:0;
    width:100%;
  }

  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    min-height:44px;
    font-size:1rem;
  }

  .workflow-form-actions button{
    min-height:42px;
    min-width:82px;
  }
}

@media (pointer: coarse) and (prefers-color-scheme: light){
  .workflow-sheet{
    background:rgba(255,250,243,.95);
    box-shadow:
      0 20px 54px rgba(0,0,0,.20),
      0 3px 12px rgba(0,0,0,.12);
  }
}

.lace-dot{
  width:14px;
  height:14px;
  border-radius:999px;
  border:1px solid rgba(9,47,77,.18);
  flex:0 0 14px;
  box-shadow:none;
}

.custom-dot{
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, #dacab1, #092f4d);
  color:#020b12;
  font-size:.56rem;
  font-weight:600;
}

/* =========================
   DETAIL VIEW
   ========================= */
#detailView{
  background:var(--bg);
  min-height:100vh;
  padding:0 0 calc(18px + env(safe-area-inset-bottom));
}

#detailView .detail-topbar{
  position:sticky;
  top:0;
  z-index:25;
  min-height:var(--topbarH);
  background:var(--navy);
  color:var(--cream);
  border-bottom:1px solid rgba(218,202,177,.18);
  padding:14px 14px 12px;
}

#detailView .detail-topbar .topbar-left{
  gap:12px;
}

#detailView .detail-topbar h1{
  color:var(--cream);
}

/* Detail title shows "Customer Name · 0111". It scales down to fit (see
   fitDetailTitle) rather than truncating, so the whole name stays readable.
   line-height gives descenders (g, y, q, j, p) room — with the topbar's
   line-height:1 they were being clipped at the bottom. */
#detailView .detail-topbar .topbar-left > div{
  flex:1 1 auto;
  min-width:0;
}

#detailTitle{
  white-space:nowrap;
  line-height:1.2;
}

#detailView .detail-topbar .secondary{
  background:#244866;
  color:var(--cream);
}

.detail-topbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:0 0 auto;
}

.detail-topbar-actions .status{
  min-height:0;
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.82rem;
  color:rgba(218,202,177,.84);
  text-align:right;
}

#backBtn{
  min-height:40px;
  border-radius:14px;
  padding:0 13px;
  font-size:.9rem;
  font-weight:600;
  white-space:nowrap;
}

#saveOrderBtn{
  width:auto;
  min-height:40px;
  padding:0 14px;
  border:none;
  background:rgba(218,202,177,.92);
  color:var(--navy);
  border-radius:14px;
  font-weight:600;
  white-space:nowrap;
  flex:0 0 auto;
}

.detail-card{
  width:100%;
  max-width:940px;
  margin:0 auto;
  padding:12px;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}

.detail-form-shell{
  display:grid;
  gap:12px;
}

.detail-section{
  display:grid;
  gap:10px;
  padding:13px;
  border:1px solid rgba(218,202,177,.16);
  border-radius:18px;
  background:rgba(19,41,61,.96);
}

.detail-section-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.detail-section-header h2{
  margin:0;
  color:var(--cream);
  font-size:1.05rem;
  line-height:1.15;
  letter-spacing:-.015em;
}

.detail-show-on-map-link{
  border:none;
  background:transparent;
  color:rgba(146, 198, 255, .92);
  padding:0;
  font:inherit;
  font-size:.78rem;
  font-weight:600;
  line-height:1.2;
  cursor:pointer;
  white-space:nowrap;
}

.detail-show-on-map-link:hover,
.detail-show-on-map-link:focus-visible{
  text-decoration:underline;
  text-underline-offset:3px;
}

.detail-shipping-actions,
.detail-photo-actions{
  display:flex;
  justify-content:flex-end;
  margin:8px 0 0;
}

.detail-shipping-actions{
  margin:0 0 8px;
}

.detail-section-grid{
  display:grid;
  gap:10px;
}

.status-delivery-block{
  display:grid;
  gap:9px;
  margin-top:2px;
  padding-top:12px;
  border-top:1px solid rgba(218,202,177,.14);
}

.status-delivery-heading{
  color:rgba(218,202,177,.72);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.status-delivery-rows{
  display:grid;
  gap:0;
  border-top:1px solid rgba(218,202,177,.10);
  border-bottom:1px solid rgba(218,202,177,.10);
}

.status-delivery-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:34px;
  padding:7px 0;
  color:rgba(218,202,177,.70);
  font-size:.84rem;
}

.status-delivery-row + .status-delivery-row{
  border-top:1px solid rgba(218,202,177,.10);
}

.status-delivery-row strong{
  color:var(--cream);
  font-size:.86rem;
  font-weight:650;
  text-align:right;
}

.status-delivery-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

/* No size override needed — status/combined-bill buttons inherit the compact
   button.secondary base, so they match every other secondary button exactly. */
.status-delivery-btn:disabled{
  opacity:.46;
  cursor:not-allowed;
}

/* Custom Add-On field (Order Detail, internal): amount + short label on one row. */
.custom-addon-row{
  display:flex;
  gap:8px;
}
.custom-addon-row #editCustomAddonAmount{
  flex:0 0 34%;
  min-width:0;
}
.custom-addon-row #editCustomAddonLabel{
  flex:1 1 auto;
  min-width:0;
}

/* Lace inventory photo: "No photo" chip on rows + Set Photo form thumbnail. */
.inventory-needs-photo{
  font-size:.62rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
  color:#8a6d3b;
  background:rgba(138,109,59,.12);
  border-radius:6px;
  padding:1px 6px;
  white-space:nowrap;
}
.inventory-photo-current{
  margin-bottom:6px;
}
.inventory-photo-thumb{
  max-width:120px;
  max-height:120px;
  border-radius:8px;
  border:1px solid rgba(9,47,77,.15);
  object-fit:cover;
}

/* Combined billing: one bill for a customer's multiple unpaid gloves. */
.combined-bill-panel{
  margin-top:10px;
  padding:10px;
  border-radius:10px;
  background:rgba(9,47,77,.06);
  border:1px solid rgba(9,47,77,.12);
}
.combined-bill-info{
  font-size:.8rem;
  line-height:1.35;
  margin-bottom:8px;
}
.combined-bill-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.hold-billing-row{
  display:flex;
  align-items:flex-start;
  gap:8px;
  font-size:.8rem;
  line-height:1.35;
  cursor:pointer;
}
.hold-billing-row input{
  margin-top:2px;
  flex:0 0 auto;
}

.status-delivery-message{
  min-height:16px;
  margin:0;
  color:rgba(218,202,177,.72);
  font-size:.8rem;
  line-height:1.35;
}

.status-delivery-message[data-type="success"]{
  color:#90d7a8;
}

.status-delivery-message[data-type="error"]{
  color:#ffb4ae;
}

.order-activity-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
}

.order-activity-toggle:focus-visible{
  outline:2px solid rgba(0,122,255,.45);
  outline-offset:2px;
  border-radius:6px;
}

.order-activity-toggle-main{
  display:flex;
  align-items:baseline;
  gap:6px;
  min-width:0;
}

.order-activity-toggle-title{
  margin:0;
  color:var(--cream);
  font-size:1.05rem;
  line-height:1.15;
  letter-spacing:-.015em;
  font-weight:650;
}

.order-activity-toggle-meta,
.detail-section-summary{
  font-size:.82rem;
  font-weight:500;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:0;
}

.detail-section-toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.detail-section-toggle-row .detail-section-toggle{
  flex:1;
  min-width:0;
}

.order-activity-chevron{
  flex:0 0 auto;
  color:rgba(218,202,177,.58);
  font-size:1.1rem;
  line-height:1;
  transition:transform var(--motion-base, .18s) ease;
}

.detail-collapsible-section:not(.is-collapsed):not(.is-empty) .order-activity-chevron{
  transform:rotate(90deg);
}

.detail-collapsible-section.is-collapsed .detail-section-body{
  display:none;
}

.detail-collapsible-section.is-empty .detail-section-toggle{
  cursor:default;
  pointer-events:none;
}

.detail-collapsible-section.is-empty .order-activity-chevron{
  display:none;
}

.order-activity-list{
  display:grid;
  gap:8px;
}

.order-activity-empty{
  margin:0;
  color:rgba(218,202,177,.70);
  font-size:.84rem;
}

.order-activity-group{
  display:grid;
  gap:3px;
}

.order-activity-date{
  color:rgba(218,202,177,.66);
  font-size:.7rem;
  font-weight:750;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.order-activity-row{
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:7px 0;
  border-top:1px solid rgba(218,202,177,.10);
}

.order-activity-time{
  color:rgba(218,202,177,.64);
  font-size:.78rem;
  line-height:1.35;
  white-space:nowrap;
}

.order-activity-main{
  display:grid;
  gap:2px;
  min-width:0;
}

.order-activity-main strong{
  color:var(--cream);
  font-size:.84rem;
  font-weight:650;
  line-height:1.25;
}

.order-activity-main span{
  color:rgba(218,202,177,.70);
  font-size:.81rem;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.labor-timer{
  display:grid;
  gap:10px;
  min-width:0;
}

.labor-timer-card{
  display:grid;
  gap:8px;
  padding:10px 12px;
  border:1px solid rgba(9,47,77,.10);
  border-radius:12px;
  background:rgba(255,250,243,.72);
  min-width:0;
}

.labor-timer-card--active{
  border-color:rgba(9,47,77,.18);
  background:rgba(255,250,243,.92);
}

.labor-timer-active-label,
.labor-timer-history-label,
.labor-timer-total-label{
  color:rgba(9,47,77,.56);
  font-size:.64rem;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
  line-height:1.2;
}

.labor-timer-active-main{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.labor-timer-active-main strong{
  color:var(--navy);
  font-size:.9rem;
  font-weight:650;
  line-height:1.25;
}

.labor-timer-elapsed{
  flex:0 0 auto;
  color:var(--navy);
  font-size:.88rem;
  font-weight:700;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
}

.labor-timer-active-meta{
  font-size:.74rem;
  line-height:1.3;
}

.labor-timer-controls{
  gap:10px;
}

.labor-timer-field{
  display:grid;
  gap:4px;
  min-width:0;
}

.labor-timer-label{
  color:rgba(9,47,77,.62);
  font-size:.68rem;
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
  line-height:1.2;
}

.labor-timer-select{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  max-width:100%;
  height:32px;
  min-height:32px;
  padding:0 28px 0 10px;
  border:1px solid rgba(9,47,77,.14);
  border-radius:10px;
  background:#fffaf3;
  color:var(--navy);
  font-size:.8rem;
  font-weight:500;
  line-height:1.2;
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23092f4d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:11px 11px;
}

.labor-timer-select:disabled{
  opacity:.72;
}

.labor-timer-notes{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:58px;
  padding:8px 10px;
  border:1px solid rgba(9,47,77,.14);
  border-radius:10px;
  background:#fffaf3;
  color:var(--navy);
  font-size:.8rem;
  line-height:1.35;
  resize:vertical;
}

.labor-timer-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.labor-timer-btn{
  box-sizing:border-box;
  min-height:32px;
  padding:6px 12px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:10px;
  background:#fffaf3;
  color:var(--navy);
  font-size:.78rem;
  font-weight:600;
  line-height:1.2;
  cursor:pointer;
}

.labor-timer-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.labor-timer-btn--stop{
  border-color:rgba(9,47,77,.22);
  background:rgba(9,47,77,.06);
}

.labor-timer-total{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.labor-timer-total-value{
  color:var(--navy);
  font-size:.9rem;
  font-weight:700;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
}

.labor-timer-history{
  display:grid;
  gap:6px;
  min-width:0;
}

.labor-session-list{
  display:grid;
  gap:6px;
  min-width:0;
}

.labor-session-row{
  display:grid;
  gap:3px;
  padding:8px 10px;
  border:1px solid rgba(9,47,77,.08);
  border-radius:10px;
  background:rgba(255,250,243,.55);
  min-width:0;
}

.labor-session-main{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}

.labor-session-main strong{
  color:var(--navy);
  font-size:.82rem;
  font-weight:650;
  line-height:1.25;
  min-width:0;
}

.labor-session-duration{
  flex:0 0 auto;
  color:var(--navy);
  font-size:.8rem;
  font-weight:700;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
}

.labor-session-meta{
  display:grid;
  gap:2px;
  font-size:.72rem;
  line-height:1.3;
  overflow-wrap:anywhere;
}

.labor-session-notes{
  color:rgba(9,47,77,.68);
}

.labor-timer-empty{
  margin:0;
  font-size:.8rem;
  line-height:1.35;
}

.labor-timer-error{
  margin:0;
  padding:8px 10px;
  border:1px solid rgba(176,74,58,.24);
  border-radius:10px;
  background:rgba(176,74,58,.08);
  color:#8f3f31;
  font-size:.78rem;
  line-height:1.35;
}

.detail-grid{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.detail-order-number{
  font-size:1.18rem;
  font-weight:600;
  color:var(--light-ink);
  line-height:1.2;
}

.detail-order-status{
  margin-top:4px;
  color:var(--light-muted);
  font-size:.96rem;
}

.detail-section-title{
  font-weight:600;
  color:var(--light-ink);
  margin:6px 0 0;
  padding-top:10px;
  border-top:2px solid var(--light-line-strong);
}

.detail-section-title.full{
  grid-column:1 / -1;
}

.detail-block{
  width:100%;
  min-width:0;
}

.detail-block.full{
  width:100%;
}

.label{
  display:block;
  margin:0 0 5px;
  color:rgba(218,202,177,.72);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.value{
  white-space:pre-wrap;
  word-break:break-word;
  color:var(--light-ink);
  line-height:1.45;
}

/* editable and readonly blocks can share the same visual shell */
.detail-block input,
.detail-block select,
.detail-block textarea,
.detail-block .field-like{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  background:#244866;
  color:var(--cream);
  border:1px solid rgba(218,202,177,.16);
  border-radius:14px;
  padding:8px 11px;
  font-size:.92rem;
  font-weight:500;
  line-height:1.2;
  min-height:40px;
}

.detail-block select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(218,202,177,.9) 50%),
    linear-gradient(135deg, rgba(218,202,177,.9) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 10px) 17px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:34px;
}

.detail-block .field-like{
  min-height:40px;
  display:flex;
  align-items:center;
}

.detail-block textarea{
  resize:vertical;
  min-height:58px;
  line-height:1.35;
}

.detail-block input::placeholder,
.detail-block textarea::placeholder{
  color:rgba(218,202,177,.45);
}

.detail-block input[type="date"]{
  width:100%;
  display:block;
  -webkit-appearance:none;
  appearance:none;
}

.detail-block input[readonly],
.detail-block textarea[readonly],
.detail-block .field-like.readonly{
  background:rgba(218,202,177,.08);
  color:rgba(218,202,177,.88);
}

.detail-delete-row{
  display:flex;
  justify-content:flex-start;
  padding:2px 2px 8px;
}

.detail-delete-btn{
  min-height:36px;
  border:1px solid rgba(255,107,120,.30);
  border-radius:12px;
  padding:0 13px;
  background:rgba(146,26,36,.14);
  color:#ffd5da;
  font:inherit;
  font-size:.84rem;
  font-weight:600;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}

.detail-divider{
  border-top:2px solid var(--light-line-strong);
  margin:2px 0 0;
}

/* utility in case JS wants to truly hide empty fields */
.is-hidden{
  display:none !important;
}

/* =========================
   DESKTOP
   ========================= */
@media (min-width: 900px){
  .side-menu{
    transform:none;
  }

  .menu-backdrop{
    display:none;
  }

  .main-panel{
    margin-left:var(--menuW);
    max-width:none;
    width:calc(100% - var(--menuW));
    padding:0 20px;
  }

  .mobile-only{
    display:none;
  }

  .topbar-left > .icon-btn[aria-label="Open menu"],
  .search-close-btn{
    display:none;
  }

  .topbar h1,
  #viewTitle,
  #detailView .detail-topbar h1{
    font-size:1.18rem;
    font-weight:600;
  }

  .search-toolbar{
    top:var(--topbarH);
    padding:8px 0 10px;
  }

  .search-control{
    grid-template-columns:1fr;
    max-width:640px;
    margin:0 auto;
  }

  .orders-list{
    border-top:1px solid var(--line);
  }

  .order-top{
    grid-template-columns:minmax(0, 1fr) max-content;
  }

  .order-status{
    justify-self:end;
    max-width:260px;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .order-subrow{
    grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .workflow-progress{
    justify-self:end;
  }

  .swipe-row{
    overflow:visible;
  }

  .swipe-row.actions-open{
    z-index:5;
  }

  .order-actions-wrap{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    align-self:center;
  }

  .order-actions-btn{
    width:28px;
    height:22px;
    min-width:28px;
    border:0;
    border-radius:6px;
    background:transparent;
    color:rgba(9,47,77,.50);
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:.86rem;
    line-height:1;
    letter-spacing:.5px;
    box-shadow:none;
  }

  .order-actions-btn:hover,
  .order-actions-btn:focus-visible,
  .order-actions-btn[aria-expanded="true"]{
    background:rgba(9,47,77,.06);
    color:var(--navy);
  }

  .order-actions-menu{
    position:fixed;
    left:0;
    top:0;
    z-index:1000;
    min-width:132px;
    display:grid;
    gap:2px;
    padding:5px;
    border-radius:14px;
    background:rgba(255,250,243,.98);
    border:1px solid rgba(9,47,77,.12);
    box-shadow:0 14px 34px rgba(9,47,77,.16);
    -webkit-backdrop-filter:blur(18px) saturate(1.2);
    backdrop-filter:blur(18px) saturate(1.2);
  }

  .order-actions-menu[hidden]{
    display:none;
  }

  .order-menu-action{
    width:100%;
    min-height:32px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--navy);
    padding:0 10px;
    text-align:left;
    font-size:.84rem;
    font-weight:500;
  }

  .order-menu-action:hover,
  .order-menu-action:focus-visible{
    background:rgba(9,47,77,.08);
  }

  .order-menu-delete{
    color:var(--red);
  }

  .detail-card{
    width:100%;
    margin-top:14px;
    padding:12px;
  }

  .detail-section-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .store-editor-panel{
    max-width:940px;
    margin:0 auto;
  }

  .store-editor-card .detail-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .map-card{
    max-width:none;
  }

  .order-map{
    height:clamp(520px, calc(100vh - var(--topbarH) - 96px), 820px);
  }

  .detail-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px 20px;
  }

  .detail-section-title.full,
  .detail-block.full,
  .detail-grid > .full,
  .detail-section-grid > .full,
  .detail-divider{
    grid-column:1 / -1;
  }

  .login-card{
    max-width:520px;
    margin-top:95px;
  }
}

.checkbox-group{
  display:grid;
  gap:12px;
  margin-top:4px;
}

.checkbox-item{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
  color:var(--cream);
  font-size:.9rem;
}

.detail-block input[type="checkbox"]{
  width:18px;
  height:18px;
  min-height:18px;
  padding:0;
  margin:0;
  border:none;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  accent-color:var(--navy);
  justify-self:start;
}

.detail-card .photo-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(72px, 1fr));
  gap:8px;
}

.photo-thumb-wrap{
  position:relative;
  min-width:0;
}

.detail-photo-add-btn{
  width:36px;
  min-width:36px;
  height:36px;
  min-height:36px;
  border-radius:12px;
  font-size:1.2rem;
}

.order-photo-status{
  min-height:18px;
  margin:0;
}

.order-photo-empty{
  margin:0;
}

.detail-card .photo-thumb-img{
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  object-fit:cover;
  border:1px solid rgba(218,202,177,.16);
  border-radius:13px;
  background:rgba(218,202,177,.07);
  cursor:pointer;
}

.swipe-row{
  position: relative;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
  --deleteSwipeWidth: 70px;
  --quickSwipeWidth: 0px;
}

.swipe-action-panel{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
  transition:
    opacity 120ms ease,
    visibility 0s linear 120ms;
}

.swipe-actions-start{
  justify-content: flex-start;
  background: transparent;
}

.swipe-actions-end{
  justify-content: flex-end;
  background: transparent;
}

.swipe-row.swiped-right .swipe-actions-start{
  background: transparent;
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition:
    opacity 120ms ease,
    visibility 0s;
}

.swipe-row.swiped-left .swipe-actions-end{
  background: transparent;
  opacity: 1;
  visibility: visible;
  z-index: 1;
  transition:
    opacity 120ms ease,
    visibility 0s;
}

.swipe-row.swiped-right .swipe-actions-start,
.swipe-row.swiped-left .swipe-actions-end{
  pointer-events: auto;
}

.swipe-quick-actions{
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  min-width: var(--quickSwipeWidth);
}

.swipe-circle-action{
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  color: #fffaf3;
  font: inherit;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  transform: scale(.94);
  transition:
    opacity 120ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 120ms;
  box-shadow:
    0 8px 16px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.16);
  -webkit-tap-highlight-color: transparent;
}

.swipe-row.swiped-right .swipe-actions-start .swipe-circle-action,
.swipe-row.swiped-left .swipe-actions-end .swipe-circle-action{
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition:
    opacity 120ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

.swipe-circle-text{
  background: linear-gradient(180deg, rgba(45,98,140,.98), rgba(23,63,96,.98));
}

.swipe-circle-email{
  background: linear-gradient(180deg, rgba(218,202,177,.28), rgba(218,202,177,.18));
  border: 1px solid rgba(218,202,177,.26);
}

.swipe-circle-ship{
  background: linear-gradient(180deg, rgba(151,105,54,.98), rgba(110,77,40,.98));
}

.swipe-action-svg{
  width: 23px;
  height: 23px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.swipe-delete-btn{
  width: 50px;
  height: 50px;
  align-self: center;
  margin-right: 10px;
  border: 0;
  border-radius: 999px;
  background: #921a24;
  color: #fffaf3;
  font: inherit;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  box-shadow:
    0 8px 16px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.14);
  -webkit-tap-highlight-color: transparent;
}

.swipe-row.swiped-left .swipe-delete-btn{
  opacity: 1;
  transform: scale(1);
}

.swipe-row.swiped-left .swipe-delete-btn{
  background: #921a24;
}

.swipe-row .order-card{
  position: relative;
  z-index: 2;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.swipe-row.swiped-right .order-card{
  transform: translateX(var(--quickSwipeWidth));
}

.swipe-row.swiped-left .order-card{
  transform: translateX(calc(var(--deleteSwipeWidth) * -1));
}

/* =========================
   MOBILE
   ========================= */
@media (max-width: 899px){
  :root{
    --topbarH:78px;
  }

  input,
  select,
  textarea,
  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    font-size:16px;
  }

  #detailView{
    padding:0 0 calc(14px + env(safe-area-inset-bottom));
  }

  #detailView .detail-section-summary{
    display:none;
  }

  #detailView .detail-topbar{
    padding:14px 14px 12px;
  }

  /* keep both dashboard and detail topbars in one row on mobile */
  .topbar,
  #detailView .detail-topbar{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:nowrap;
  }

  .topbar-actions{
    gap:6px;
  }

  .gallery-manager-card .upload-card-heading{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }

  .gallery-manager-controls{
    width:100%;
    justify-content:flex-start;
  }

  .gallery-manager-filter{
    flex:1 1 auto;
    width:100%;
    min-width:0;
    max-width:none;
  }

  .topbar-icon-action{
    min-width:40px;
    height:40px;
  }

  .sale-add-btn{
    width:auto;
    min-width:0;
    min-height:40px;
    flex-basis:auto;
  }

  .topbar-left{
    width:auto;
    min-width:0;
    flex:1 1 auto;
  }

  .topbar-left > div{
    min-width:0;
  }

  .topbar h1,
  #viewTitle,
  #detailView .detail-topbar h1{
    font-size:.95rem;
  }

  .topbar .topbar-subtitle{
    font-size:.7rem;
  }

  .map-panel{
    padding:10px 10px calc(14px + env(safe-area-inset-bottom));
  }

  .map-card{
    border-radius:16px;
    padding:10px;
    gap:9px;
  }

  .order-map{
    min-height:420px;
    height:calc(100dvh - var(--topbarH) - 118px);
    border-radius:15px;
  }

  .map-unmapped-item{
    align-items:stretch;
    flex-direction:column;
  }

  .map-unmapped-btn{
    width:100%;
  }

  .detail-topbar-actions{
    flex-direction:row;
    align-items:center;
    justify-content:flex-end;
    gap:6px;
    width:auto;
    min-width:0;
    flex:0 0 auto;
  }

  .detail-topbar-actions .status{
    text-align:right;
    min-height:auto;
    font-size:.78rem;
    max-width:82px;
  }

  #backBtn{
    min-height:40px;
    padding:0 11px;
    font-size:.84rem;
  }

  #saveOrderBtn{
    width:auto;
    min-height:40px;
    padding:0 12px;
    flex:0 0 auto;
    white-space:nowrap;
    font-size:.84rem;
  }

  .detail-card{
    padding:10px;
  }

  .dashboard-section-finance .dashboard-finance-custom{
    display:grid;
    grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
    column-gap:8px;
    row-gap:0;
    align-items:start;
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .dashboard-section-finance .dashboard-finance-custom label{
    min-width:0;
    width:100%;
    max-width:100%;
    display:grid;
    gap:3px;
    line-height:1.1;
  }

  /* Finance custom dates stay compact — excluded from 16px anti-zoom rule */
  .dashboard-section-finance .dashboard-finance-custom input[type="date"]{
    -webkit-appearance:none;
    appearance:none;
    display:block;
    width:100%;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
    height:34px;
    min-height:34px;
    max-height:34px;
    padding:3px 8px;
    font-size:.9rem !important;
    line-height:1.2;
    text-align:left;
  }

  .dashboard-section-finance .dashboard-finance-custom input[type="date"]::-webkit-date-and-time-value{
    margin:0;
    line-height:1.2;
    text-align:left;
  }
}

/* =========================
   ADMIN V2 CREAM THEME
   ========================= */
html,
body,
.app-shell,
.main-panel,
#homeDashboardView,
#dashboardView,
#detailView{
  background:var(--bg);
  color:var(--ink);
}

.topbar,
#detailView .detail-topbar,
.search-toolbar{
  background:rgba(244,238,228,.94);
  color:var(--navy);
  border-bottom:1px solid rgba(9,47,77,.12);
  box-shadow:0 8px 24px rgba(9,47,77,.06);
}

.topbar,
#detailView .detail-topbar,
.admin-filter-popover,
.workflow-sheet{
  -webkit-backdrop-filter:blur(18px) saturate(1.2);
  backdrop-filter:blur(18px) saturate(1.2);
}

.topbar h1,
#viewTitle,
#detailView .detail-topbar h1{
  color:var(--navy);
}

.topbar .topbar-subtitle,
.detail-topbar-actions .status{
  margin:4px 0 0;
  min-height:1.35em;
  font-size:.95rem;
  line-height:1.35;
  color:rgba(9,47,77,.66);
}

.icon-btn,
button.secondary,
.topbar-icon-action,
#detailView .detail-topbar .secondary,
#backBtn,
.logout-action,
.sale-add-btn,
.inventory-add-btn,
.store-empty-add{
  background:rgba(9,47,77,.10);
  color:var(--navy);
  border:1px solid rgba(9,47,77,.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.50);
}

.icon-btn:active,
button.secondary:active,
.topbar-icon-action:active,
#backBtn:active,
.logout-action:active,
.sale-add-btn:active,
.inventory-add-btn:active{
  background:rgba(9,47,77,.16);
}

#saveOrderBtn,
.gallery-upload-card .upload-primary:not(:disabled),
.store-editor-card .upload-primary:not(:disabled),
.store-save-btn,
.map-unmapped-btn,
.workflow-form-actions .workflow-form-submit{
  background:var(--navy) !important;
  color:#fffaf3 !important;
}

.side-menu{
  background:rgba(255,250,243,.96);
  color:var(--navy);
  border-right:1px solid rgba(9,47,77,.14);
  box-shadow:18px 0 38px rgba(9,47,77,.18);
}

.brand-title,
.nav-link,
.nav-parent{
  color:var(--navy);
}

.brand-subtitle,
.nav-children .nav-link{
  color:rgba(9,47,77,.66);
}

.nav-link.active,
.nav-parent,
.nav-main{
  background:rgba(9,47,77,.10);
}

.nav-link:active,
.nav-parent:active{
  background:rgba(9,47,77,.14);
}

.toolbar{
  background:var(--bg);
  border-bottom:1px solid rgba(9,47,77,.12);
}

.inventory-filter-toggle.is-active,
.order-filter-toggle.is-active,
.admin-filter-list button.active{
  background:var(--navy);
  color:#fffaf3;
}

.inventory-filter-toggle.has-active-filter::after,
.order-filter-toggle.has-active-filter::after{
  box-shadow:none;
}

.admin-filter-popover{
  background:rgba(255,250,243,.96);
  border:1px solid rgba(9,47,77,.14);
  box-shadow:0 18px 42px rgba(9,47,77,.16);
}

.admin-filter-list button{
  color:rgba(9,47,77,.78);
}

.search-field-shell{
  background:rgba(255,250,243,.92);
  border:1px solid rgba(9,47,77,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72);
}

.search-field-shell:focus-within{
  background:#fffaf3;
  border-color:rgba(9,47,77,.22);
  box-shadow:0 0 0 3px rgba(9,47,77,.08);
}

.search-field-icon{
  stroke:rgba(9,47,77,.58);
}

.search-field-shell input{
  color:var(--navy);
}

.search-field-shell input::placeholder{
  color:rgba(9,47,77,.45);
}

.search-clear-btn{
  background:rgba(9,47,77,.14);
  color:var(--navy);
}

.search-close-btn{
  color:var(--navy);
}

.pull-refresh-indicator,
.pull-refresh-indicator.ready{
  background:rgba(255,250,243,.96);
  color:var(--navy);
  border:1px solid rgba(9,47,77,.14);
  box-shadow:0 12px 28px rgba(9,47,77,.16);
}

.pull-refresh-spinner{
  border-color:rgba(9,47,77,.18);
  border-top-color:var(--navy);
}

.upload-card,
.gallery-upload-card,
.gallery-manager-card,
.inventory-card,
.order-card,
.sale-glove-row,
.store-empty-state,
.store-editor-card,
.map-card,
.detail-section{
  background:rgba(255,250,243,.96);
  color:var(--navy);
  border-color:rgba(9,47,77,.12);
  box-shadow:0 8px 22px rgba(9,47,77,.06);
}

.order-card{
  background:#fffaf3;
}

.inventory-card,
.order-card,
.sale-glove-row{
  box-shadow:none;
}

.inventory-card,
.sale-glove-row{
  border-bottom:1px solid rgba(9,47,77,.12);
}

.sale-glove-row:active{
  background:rgba(9,47,77,.07);
}

.upload-card h2,
.gallery-upload-card h2,
.gallery-manager-card h2,
.store-editor-header h2,
.store-photo-header h3,
.map-card h2,
.detail-section-header h2,
.order-activity-toggle-title,
.store-empty-state strong,
.inventory-color-name,
.inventory-qty strong,
.order-name,
.order-status,
.sale-glove-title{
  color:var(--navy);
}

.sale-glove-price{
  color:rgba(9,47,77,.82);
}

.muted,
.upload-drop-note,
.gallery-upload-card .upload-drop-note,
.store-editor-card .upload-drop-note,
.upload-status,
.gallery-upload-card .upload-status,
.store-editor-card .upload-status,
.inventory-card-row-meta,
.inventory-reorder,
.sale-glove-meta,
.store-empty-state,
.map-card .muted,
.map-unmapped-main,
.order-subrow,
.no-results{
  color:rgba(9,47,77,.64);
}

.label,
.gallery-upload-card .label,
.store-editor-card .label{
  color:rgba(9,47,77,.62);
}

.value,
.detail-order-number,
.detail-section-title{
  color:var(--navy);
}

.detail-order-status{
  color:rgba(9,47,77,.64);
}

.order-activity-empty{
  color:rgba(9,47,77,.62);
}

.order-activity-date{
  color:rgba(9,47,77,.56);
}

.order-activity-row{
  border-top-color:rgba(9,47,77,.10);
}

.order-activity-time{
  color:rgba(9,47,77,.58);
}

.order-activity-main strong{
  color:var(--navy);
}

.order-activity-main span{
  color:rgba(9,47,77,.66);
}

.gallery-upload-card select,
.gallery-manager-filter,
.gallery-manager-action-select,
.store-editor-card .detail-block input,
.store-editor-card .detail-block select,
.store-editor-card .detail-block textarea,
.sale-photo-action-select,
.detail-block input,
.detail-block select,
.detail-block textarea,
.detail-block .field-like,
.workflow-action-form input:not([type="checkbox"]),
.workflow-action-form textarea,
.workflow-action-form select,
.login-card input{
  background:#fffaf3;
  color:var(--navy);
  border:1px solid rgba(9,47,77,.16);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}

.gallery-upload-card select,
select.gallery-manager-filter,
.gallery-manager-action-select,
.store-editor-card .detail-block select,
.sale-photo-action-select,
.detail-block select,
.workflow-action-form select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  background-color:#fffaf3;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23092f4d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:14px 14px;
  border-radius:14px;
  padding-right:38px;
}

.gallery-manager-action-select,
.sale-photo-action-select{
  background-position:right 8px center;
  background-size:12px 12px;
}

.detail-block input::placeholder,
.detail-block textarea::placeholder,
.store-editor-card .detail-block input::placeholder,
.store-editor-card .detail-block textarea::placeholder,
.workflow-action-form input::placeholder,
.workflow-action-form textarea::placeholder{
  color:rgba(9,47,77,.42);
}

.detail-block input[readonly],
.detail-block textarea[readonly],
.detail-block .field-like.readonly{
  background:rgba(9,47,77,.06);
  color:rgba(9,47,77,.76);
}

.status-delivery-block{
  border-top-color:rgba(9,47,77,.14);
}

.status-delivery-heading{
  color:rgba(9,47,77,.68);
}

.status-delivery-rows{
  border-top-color:rgba(9,47,77,.12);
  border-bottom-color:rgba(9,47,77,.12);
}

.status-delivery-row{
  color:rgba(9,47,77,.72);
}

.status-delivery-row + .status-delivery-row{
  border-top-color:rgba(9,47,77,.10);
}

.status-delivery-row strong{
  color:var(--navy);
}

.status-delivery-btn{
  background:rgba(9,47,77,.08);
  color:var(--navy);
  border:1px solid rgba(9,47,77,.12);
}

.status-delivery-btn:not(:disabled):hover,
.status-delivery-btn:not(:disabled):focus-visible{
  background:rgba(9,47,77,.12);
}

.status-delivery-btn:disabled{
  opacity:.56;
}

.status-delivery-message{
  color:rgba(9,47,77,.68);
}

.status-delivery-message[data-type="success"]{
  color:#197246;
}

.status-delivery-message[data-type="error"]{
  color:var(--red);
}

.checkbox-item,
.checkbox-other-choice{
  color:var(--navy);
}

.upload-drop,
.gallery-upload-card .upload-drop,
.store-editor-card .upload-drop{
  background:rgba(9,47,77,.05);
  border-color:rgba(9,47,77,.14);
  color:var(--navy);
}

.gallery-upload-card .upload-drop:hover{
  background:rgba(9,47,77,.07);
  border-color:rgba(9,47,77,.20);
}

.upload-drop-icon{
  background:rgba(9,47,77,.10);
  color:var(--navy);
}

.upload-preview-item,
.gallery-upload-card .upload-preview-item,
.gallery-manager-item,
.gallery-manager-thumb,
.store-editor-card .upload-preview-item,
.sale-photo-badges span,
.detail-card .photo-thumb-img{
  background:rgba(9,47,77,.05);
  border-color:rgba(9,47,77,.12);
}

.upload-preview-name,
.gallery-manager-name,
.sale-photo-badges span{
  color:rgba(9,47,77,.62);
}

.gallery-manager-subrow{
  color:rgba(9,47,77,.58);
}

.gallery-manager-pill{
  background:rgba(9,47,77,.08);
  color:rgba(9,47,77,.66);
}

.gallery-manager-item.is-gallery-hidden .gallery-manager-pill{
  background:rgba(146,26,36,.10);
  color:var(--red);
}

.inventory-status-ignore .inventory-status-pill,
.sale-status-draft{
  background:rgba(9,47,77,.08);
  color:rgba(9,47,77,.66);
  border-color:rgba(9,47,77,.12);
}

.workflow-step{
  background:rgba(9,47,77,.20);
}

.workflow-step.complete{
  background:rgba(9,47,77,.58);
}

.workflow-step.active{
  background:var(--navy);
}

.workflow-connector{
  background:rgba(9,47,77,.16);
}

.workflow-connector.complete{
  background:rgba(9,47,77,.46);
}

.lace-dot{
  border-color:rgba(9,47,77,.18);
  box-shadow:none;
}

.workflow-sheet{
  color:var(--navy);
  background:rgba(255,250,243,.96);
  border:1px solid rgba(9,47,77,.14);
  box-shadow:
    0 18px 46px rgba(9,47,77,.18),
    0 2px 8px rgba(9,47,77,.10);
}

.workflow-sheet-header,
.workflow-sheet-form{
  border-color:rgba(9,47,77,.12);
}

.workflow-sheet-form.is-submenu{
  color:var(--navy);
  background:rgba(255,250,243,.96);
  border-color:rgba(9,47,77,.14);
  box-shadow:
    0 18px 46px rgba(9,47,77,.18),
    0 2px 8px rgba(9,47,77,.10);
}

.workflow-customer-name,
.workflow-action-btn,
.workflow-action-form label,
.workflow-action-form p{
  color:var(--navy);
}

.workflow-order-number,
.workflow-current-status{
  color:rgba(9,47,77,.60);
}

.workflow-action-btn.active,
.workflow-action-btn.active:hover,
.workflow-action-btn:hover{
  background:#0a84ff;
  color:#fff;
}

.workflow-form-actions .workflow-form-cancel{
  background:rgba(9,47,77,.10);
  color:var(--navy);
}

.workflow-form-message{
  color:var(--red);
  background:rgba(146,26,36,.08);
  border:1px solid rgba(146,26,36,.18);
}

.order-map{
  background:#e9e3d8;
  border-color:rgba(9,47,77,.14);
}

.map-unmapped-title,
.map-unmapped-main strong{
  color:var(--navy);
}

.map-unmapped-item{
  background:rgba(255,250,243,.72);
  border-color:rgba(9,47,77,.12);
}

.swipe-circle-action{
  box-shadow:
    0 8px 18px rgba(9,47,77,.18),
    inset 0 1px 0 rgba(255,255,255,.18);
}

.swipe-circle-text{
  background:linear-gradient(180deg, #1b5f95, #0d426b);
}

.swipe-circle-email{
  background:linear-gradient(180deg, #6f7d8b, #4d5d6c);
  border:0;
}

.swipe-circle-ship{
  background:linear-gradient(180deg, #9a6935, #745029);
}

.swipe-delete-btn{
  box-shadow:
    0 8px 18px rgba(146,26,36,.20),
    inset 0 1px 0 rgba(255,255,255,.16);
}

.detail-delete-btn,
.gallery-upload-card .upload-clear:not(:disabled),
.store-editor-card .upload-clear:not(:disabled),
.store-delete-btn{
  background:rgba(146,26,36,.10) !important;
  color:var(--red) !important;
  border-color:rgba(146,26,36,.22);
}

#loginView{
  background:
    radial-gradient(circle at top left, rgba(218,202,177,.45), transparent 36%),
    linear-gradient(180deg, #f4eee4 0%, #eadfcf 100%);
}

.login-card{
  background:rgba(255,250,243,.96);
  border:1px solid rgba(9,47,77,.14);
  box-shadow:0 16px 34px rgba(9,47,77,.12);
}

/* =========================
   ADMIN V2 TYPE POLISH
   ========================= */
.topbar h1,
#viewTitle,
#detailView .detail-topbar h1,
.detail-section-header h2,
.store-editor-header h2,
.store-photo-header h3,
.upload-card h2,
.gallery-upload-card h2,
.gallery-manager-card h2,
.map-card h2{
  font-weight:600;
}

.order-name,
.order-status,
.order-number,
.inventory-color-name,
.inventory-qty strong,
.sale-glove-title,
.detail-section-title,
.detail-order-number,
.map-popup-name,
.map-unmapped-title,
.map-unmapped-main strong,
.store-empty-state strong{
  font-weight:500;
}

button,
.icon-btn,
button.secondary,
.topbar-icon-action,
.logout-action,
.sale-add-btn,
.inventory-add-btn,
.store-empty-add,
.admin-filter-list button,
.workflow-action-btn,
.workflow-form-actions button,
.admin-action-btn,
.map-unmapped-btn,
.map-popup-btn,
.detail-delete-btn,
.store-delete-btn,
.gallery-upload-card .upload-primary,
.gallery-upload-card .upload-clear,
.store-editor-card .upload-primary,
.store-editor-card .upload-clear,
.store-save-btn{
  font-weight:500;
}

.label,
.gallery-upload-card .label,
.store-editor-card .label,
.upload-preview-name,
.sale-photo-badges span{
  font-weight:500;
}

.inventory-status-pill,
.map-status-warning,
.pull-refresh-indicator{
  font-weight:500;
}

@media (max-width: 899px){
  .topbar h1,
  #viewTitle,
  #detailView .detail-topbar h1{
    font-weight:600;
  }
}

/* =========================
   SOURCE LIST POLISH
   ========================= */
.side-menu{
  padding:16px 10px;
  background:rgba(255,250,243,.96);
}

.side-menu-header{
  margin-bottom:14px;
  padding:0 4px;
}

.brand-logo{
  width:34px;
  height:34px;
}

.brand-title{
  font-size:.94rem;
  font-weight:500;
}

.side-nav{
  gap:3px;
}

.nav-link,
.nav-parent{
  min-height:40px;
  padding:9px 10px 9px 12px;
  border-radius:9px;
  background:transparent;
  color:rgba(9,47,77,.76);
  font-size:.92rem;
  font-weight:500;
  box-shadow:none;
  position:relative;
}

.nav-main{
  background:transparent;
  font-weight:500;
}

.nav-link.active{
  background:rgba(9,47,77,.08);
  color:var(--navy);
}

.nav-link.active::before{
  content:"";
  position:absolute;
  left:4px;
  top:9px;
  bottom:9px;
  width:3px;
  border-radius:999px;
  background:var(--navy);
}

.nav-parent:active,
.nav-link:active{
  background:rgba(9,47,77,.06);
}

.nav-children{
  gap:3px;
  padding-left:10px;
}

.nav-children .nav-link{
  font-size:.86rem;
  color:rgba(9,47,77,.62);
}

@media (min-width: 900px){
  .side-menu{
    box-shadow:none;
  }

  .side-nav{
    gap:2px;
  }

  .nav-link,
  .nav-parent{
    min-height:32px;
    padding-top:7px;
    padding-bottom:7px;
    font-size:.9rem;
  }

  .nav-link.active::before{
    top:8px;
    bottom:8px;
  }

  .topbar-left{
    gap:0;
  }

  .map-card{
    max-width:none;
  }
}

/* Repair: custom admin menus stay readable even when the browser/OS is in dark mode. */
.workflow-sheet,
.workflow-sheet-form.is-submenu{
  background:rgba(255,250,243,.96);
  color:var(--navy);
  border-color:rgba(9,47,77,.16);
  box-shadow:
    0 18px 42px rgba(9,47,77,.18),
    0 2px 8px rgba(9,47,77,.10);
}

.workflow-sheet-header,
.workflow-sheet-form{
  border-color:rgba(9,47,77,.13);
}

.workflow-customer-name,
.workflow-action-btn,
.inventory-form-title{
  color:var(--navy) !important;
}

.workflow-order-number,
.workflow-current-status,
.workflow-action-form label,
.workflow-action-form p,
.inventory-check-row{
  color:rgba(9,47,77,.72) !important;
}

.workflow-action-form input:not([type="checkbox"]),
.workflow-action-form textarea,
.workflow-action-form select{
  background:#fffaf3;
  color:var(--navy);
  border-color:rgba(9,47,77,.18);
}

.workflow-action-form input::placeholder,
.workflow-action-form textarea::placeholder{
  color:rgba(9,47,77,.45);
}

.workflow-action-btn.active,
.workflow-action-btn.active:hover,
.workflow-action-btn:hover{
  background:#0a84ff;
  color:#fff !important;
}

.workflow-action-btn.danger{
  color:var(--red) !important;
}

.workflow-form-actions .workflow-form-cancel{
  background:rgba(9,47,77,.10);
  color:var(--navy);
}

.workflow-form-actions .workflow-form-submit{
  background:#0a84ff;
  color:#fff;
}

.workflow-form-message{
  color:var(--red);
  background:rgba(146,26,36,.08);
  border:1px solid rgba(146,26,36,.18);
}

@media (max-width: 899px){
  input,
  select,
  textarea,
  .detail-block input,
  .detail-block select,
  .detail-block textarea,
  .gallery-upload-card select,
  .gallery-manager-filter,
  .store-editor-card .detail-block input,
  .store-editor-card .detail-block select,
  .store-editor-card .detail-block textarea,
  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    font-size:16px !important;
  }

  /* Photo card action selects stay compact — excluded from 16px anti-zoom rule above */
  .sale-photo-action-select,
  .gallery-manager-action-select{
    min-height:28px;
    height:28px;
    padding-left:8px;
    padding-right:24px;
    font-size:.875rem !important;
    line-height:1.2;
  }
}

@media (min-width: 900px){
  :root{
    --topbarH:68px;
    --menuW:224px;
    --radius:16px;
    --admin-menu-min-width:160px;
    --admin-menu-max-width:240px;
    --admin-form-compact-max:min(360px, calc(100vw - 32px));
    --admin-form-small-max:min(360px, calc(100vw - 32px));
    --admin-form-large-max:min(360px, calc(100vw - 32px));
    --admin-submenu-max:min(360px, calc(100vw - 32px));
  }

  body{
    font-size:14px;
  }

  .main-panel{
    margin-left:var(--menuW);
    width:calc(100% - var(--menuW));
    padding:0 16px;
  }

  .topbar,
  #detailView .detail-topbar{
    min-height:var(--topbarH);
    padding:10px 12px 9px;
    gap:10px;
  }

  .topbar-left,
  #detailView .detail-topbar .topbar-left{
    gap:10px;
  }

  .topbar-actions,
  .detail-topbar-actions{
    gap:6px;
  }

  .topbar h1,
  #viewTitle,
  #detailView .detail-topbar h1{
    font-size:1.24rem;
    line-height:1.1;
  }

  .topbar .topbar-subtitle,
  .detail-topbar-actions .status{
    font-size:.7rem;
  }

  .topbar-icon-action{
    min-width:36px;
    width:36px;
    height:36px;
  }

  .topbar-icon-action svg{
    width:18px;
    height:18px;
  }

  .icon-btn,
  #backBtn,
  .logout-action,
  button.secondary,
  .admin-action-btn{
    min-height:32px;
    border-radius:11px;
    font-size:.8rem;
  }

  #backBtn{
    padding:0 11px;
  }

  .side-menu{
    width:var(--menuW);
    padding:12px 8px;
  }

  .brand{
    gap:9px;
    padding:7px 8px 10px;
  }

  .brand-logo{
    width:34px;
    height:34px;
  }

  .brand-sub{
    font-size:.7rem;
  }

  .nav-link,
  .nav-parent{
    min-height:30px;
    padding:6px 9px 6px 11px;
    font-size:.84rem;
    border-radius:8px;
  }

  .nav-children .nav-link{
    font-size:.8rem;
  }

  .dashboard-panel{
    padding:10px;
  }

  .dashboard-grid,
  .dashboard-grid-finance{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric-value{
    font-size:1rem;
  }

  .dashboard-bench-meta{
    font-size:.7rem;
  }

  .orders-list,
  .inventory-list,
  .sale-gloves-list{
    gap:8px;
  }

  .order-card{
    padding:11px 12px;
  }

  .order-name,
  .inventory-color-name,
  .sale-glove-title{
    font-size:.94rem;
  }

  .order-number{
    font-size:.96rem;
  }

  .order-status{
    font-size:.86rem;
  }

  .order-subrow{
    margin-top:6px;
    gap:8px;
  }

  .inventory-card{
    gap:6px;
    padding:10px 12px;
  }

  .inventory-card-row{
    gap:10px;
  }

  .inventory-card-row-meta{
    font-size:.84rem;
  }

  .inventory-status-pill{
    min-height:23px;
    padding:0 8px;
    font-size:.72rem;
  }

  .detail-form-shell,
  .upload-panel,
  .store-editor-shell,
  .map-panel{
    gap:10px;
  }

  .detail-section,
  .gallery-upload-card,
  .gallery-manager-card,
  .upload-card,
  .store-editor-card,
  .map-card{
    padding:11px;
    border-radius:15px;
  }

  .detail-section{
    gap:8px;
  }

  .detail-section-grid{
    gap:8px;
  }

  .detail-section-header h2,
  .gallery-upload-card h2,
  .gallery-manager-card h2,
  .map-card h2,
  .upload-card h2{
    font-size:.96rem;
  }

  .detail-block input,
  .detail-block select,
  .detail-block textarea,
  .detail-block .field-like,
  .gallery-upload-card select,
  .gallery-manager-filter,
  .store-editor-card .detail-block input,
  .store-editor-card .detail-block select,
  .store-editor-card .detail-block textarea{
    min-height:34px;
    border-radius:12px;
    font-size:.84rem;
  }

  .label,
  .gallery-upload-card .label,
  .store-editor-card .label{
    font-size:.7rem;
  }

  .gallery-manager-grid{
    grid-template-columns:repeat(auto-fill,minmax(124px,1fr));
    gap:8px;
  }

  .gallery-manager-item{
    gap:6px;
    padding:6px;
    border-radius:12px;
  }

  .workflow-sheet{
    padding:5px;
    border-radius:12px;
  }

  .workflow-sheet-header{
    padding:6px 9px 7px;
    margin-bottom:4px;
  }

  .workflow-action-btn{
    min-height:28px;
    padding:4px 8px 4px 9px;
    border-radius:7px;
    font-size:.8rem;
    gap:14px;
  }

  .workflow-sheet-form:not(:empty),
  .workflow-sheet-form.is-submenu{
    padding:7px;
  }

  .workflow-form-content{
    gap:8px;
  }

  .workflow-action-form input:not([type="checkbox"]),
  .workflow-action-form textarea,
  .workflow-action-form select{
    min-height:32px;
    padding:6px 8px;
    font-size:.82rem;
  }

  .workflow-form-actions button{
    min-height:30px;
    min-width:62px;
    padding:6px 10px;
    font-size:.78rem;
  }
}

/* =========================
   LABOR TIMER V1.1
   Clubhouse bench timer controls + Order Detail status pill.
   Scoped additions only — no existing rules modified.
   ========================= */

.dashboard-bench-actions{
  position:relative;
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

.dashboard-timer-btn{
  box-sizing:border-box;
  min-height:32px;
  height:32px;
  width:32px;
  padding:0;
  border:1px solid rgba(9,47,77,.16);
  border-radius:10px;
  background:#fffaf3;
  color:var(--navy);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}

.dashboard-timer-btn svg{
  width:15px;
  height:15px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.dashboard-timer-btn:disabled{
  opacity:.5;
  cursor:default;
}

.dashboard-timer-btn--running{
  border-color:rgba(9,47,77,.28);
  background:rgba(9,47,77,.08);
}

.dashboard-timer-btn--paused{
  border-color:rgba(9,47,77,.20);
  background:rgba(218,202,177,.28);
}

.dashboard-timer-popover{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:var(--admin-z-popover);
  min-width:170px;
  max-width:calc(100vw - 32px);
  padding:6px;
  border:1px solid rgba(9,47,77,.14);
  border-radius:14px;
  background:#fffdf8;
  box-shadow:0 14px 34px rgba(9,47,77,.16);
}

.dashboard-timer-phase-option{
  display:block;
  width:100%;
  border:0;
  border-radius:9px;
  padding:7px 10px;
  background:transparent;
  color:var(--navy);
  font-size:.8rem;
  font-weight:500;
  text-align:left;
  cursor:pointer;
}

.dashboard-timer-phase-option:hover,
.dashboard-timer-phase-option:focus-visible{
  background:rgba(9,47,77,.07);
}

.dashboard-timer-stop-option{
  color:#b3261e;
  font-weight:600;
}

.dashboard-timer-stop-option:hover,
.dashboard-timer-stop-option:focus-visible{
  background:rgba(179,38,30,.08);
}

.dashboard-bench-timer-state{
  color:rgba(9,47,77,.72);
  font-weight:600;
}

.labor-timer-status{
  display:inline-block;
  margin-left:6px;
  padding:2px 8px;
  border-radius:999px;
  font-size:.68rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  background:rgba(9,47,77,.08);
  color:var(--navy);
}

.labor-timer-status--paused{
  background:rgba(218,202,177,.45);
}

/* =========================
   SHOP ECONOMICS V1
   Money view + Order Detail economics card + estimate hint.
   Scoped additions only — no existing rules modified.
   ========================= */

.money-view{
  padding:12px;
}

.money-panel{
  display:grid;
  gap:12px;
  max-width:1080px;
  margin:0 auto;
}

.money-stat-grid{
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
}

.money-card{
  display:grid;
  gap:8px;
  padding:12px;
}

.money-card-title{
  margin:0;
  color:var(--navy);
  font-size:.82rem;
  font-weight:600;
  letter-spacing:-.01em;
}

.money-table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.money-table{
  width:100%;
  border-collapse:collapse;
  font-size:.76rem;
  color:var(--navy);
  white-space:nowrap;
}

.money-table th{
  padding:5px 10px 5px 0;
  text-align:left;
  color:rgba(9,47,77,.55);
  font-size:.66rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.04em;
  border-bottom:1px solid rgba(9,47,77,.10);
}

.money-table td{
  padding:6px 10px 6px 0;
  border-bottom:1px solid rgba(9,47,77,.06);
}

.money-table tbody tr:last-child td{
  border-bottom:none;
}

.money-job-row{
  cursor:pointer;
}

.money-job-row:active{
  background:rgba(9,47,77,.05);
}

.money-unpaid{
  font-size:.66rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.money-empty{
  padding:16px;
  text-align:center;
}

.money-error{
  padding:10px 12px;
  border:1px solid rgba(146,26,36,.18);
  border-radius:12px;
  background:rgba(146,26,36,.08);
  color:var(--red);
  font-size:.8rem;
}

.order-economics{
  display:grid;
  gap:10px;
}

.order-economics-rate{
  display:flex;
  align-items:baseline;
  gap:8px;
}

.order-economics-rate-label{
  color:rgba(9,47,77,.55);
  font-size:.68rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.order-economics-rate-value{
  color:var(--navy);
  font-size:1.05rem;
  font-weight:600;
}

.order-economics-suggestion{
  font-size:.74rem;
}

.order-economics-reason{
  font-size:.72rem;
  font-weight:500;
}

.order-economics-lines{
  display:grid;
  gap:3px;
}

.order-economics-line{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:rgba(9,47,77,.72);
  font-size:.78rem;
}

.order-economics-line--strong{
  color:var(--navy);
  font-weight:600;
}

.order-economics-pieces{
  display:grid;
  gap:4px;
}

.order-economics-pieces-label{
  color:rgba(9,47,77,.62);
  font-size:.7rem;
  font-weight:600;
}

.order-economics-pieces-input{
  box-sizing:border-box;
  width:90px;
  min-height:32px;
  padding:4px 8px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:10px;
  background:#fffaf3;
  color:var(--navy);
  font-size:.82rem;
}

.workflow-price-hint{
  margin:4px 0 0;
  font-size:.74rem;
}

/* =========================
   CONSISTENCY PASS — MASTER TOPBAR + SIDE-NAV LOGOUT
   Scoped additions only. The only intended visual changes are the
   mobile topbar fixes below and the logout button moving to the nav.
   ========================= */

/* Pin Log Out to the bottom of the menu column. */
.side-menu{
  display:flex;
  flex-direction:column;
}

.side-menu .side-menu-header,
.side-menu .side-nav{
  flex:0 0 auto;
}

/* Footer group pins the passkey + logout buttons to the bottom of the menu. */
.side-menu-footer{
  margin-top:auto;
  display:grid;
  gap:6px;
}

.nav-logout{
  text-align:left;
}

.topbar-heading{
  min-width:0;
}

@media (max-width: 899px){
  .topbar{
    flex-wrap:nowrap;
  }

  .topbar-left,
  .topbar-heading{
    min-width:0;
  }

  .topbar .topbar-title{
    font-size:1.05rem;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .topbar .topbar-subtitle{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  /* Keep every standard view subtitle compact after the later cream-theme
     base rule. New views inherit this through the shared class. */
  .topbar .topbar-subtitle{
    font-size:.7rem;
  }

  .topbar-actions{
    flex:0 0 auto;
    flex-wrap:nowrap;
  }

  .topbar-actions .topbar-icon-action,
  .topbar-actions .sale-add-btn{
    flex:0 0 auto;
  }
}

/* =========================
   CLUBHOUSE CLICKABLE ROWS
   Open button removed — the whole bench/on-deck row opens the order.
   Hover/active/transition match the clickable Shop Metrics cards.
   ========================= */
.dashboard-bench-row{
  cursor:pointer;
  border-radius:12px;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
  -webkit-user-select:none;
  transition:
    background .16s ease,
    transform .12s ease;
}

.dashboard-bench-row:hover{
  background:#fffdf8;
}

.dashboard-bench-row:active{
  transform:scale(.995);
}

.dashboard-bench-row:focus-visible{
  outline:3px solid rgba(9,47,77,.14);
  outline-offset:2px;
}

/* =========================
   BENCH FOCUS V1.3
   ========================= */
.bench-focus-card{margin:0 0 14px;border:1px solid rgba(9,47,77,.18);border-left:4px solid var(--navy);border-radius:12px;background:#fffaf3;box-shadow:0 8px 20px rgba(9,47,77,.08);overflow:hidden}
.bench-focus-context{padding:12px 12px 8px}.bench-focus-labor{padding:8px 12px 12px}
.bench-focus-eyebrow,.bench-focus-labor-heading{text-transform:uppercase;letter-spacing:.08em;font-size:.7rem;font-weight:800;color:rgba(9,47,77,.64)}
.bench-focus-heading{margin-top:3px;color:var(--navy);font-size:.96rem;font-weight:750}
.bench-focus-summary{margin-top:2px;color:rgba(9,47,77,.66);font-size:.8rem}
.bench-focus-bench-time{display:flex;flex-wrap:wrap;gap:4px 12px;margin-top:8px;color:rgba(9,47,77,.58);font-size:.72rem}.bench-focus-bench-time strong{color:var(--navy);font-size:inherit}
.bench-focus-labor{border-top:1px solid rgba(9,47,77,.08);background:#fffdf8}.bench-focus-labor.has-labor{background:rgba(9,47,77,.025)}
.bench-focus-labor-heading{font-size:.72rem;color:var(--navy)}.bench-focus-labor-status{margin-top:2px;font-size:.75rem;font-weight:700;color:#28734f}.bench-focus-labor-status strong{font-size:inherit}
.bench-focus-card-actions{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:9px}.bench-focus-labor-controls{display:flex;flex-wrap:wrap;gap:7px}.bench-focus-labor p{margin:6px 0 0;font-size:.76rem;color:rgba(9,47,77,.66)}
.bench-focus-timer-control{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:5px 9px;border:1px solid rgba(9,47,77,.16);border-radius:9px;background:#fffaf3;color:var(--navy);font:inherit;font-size:.72rem;font-weight:700;cursor:pointer}.bench-focus-timer-control svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.bench-focus-timer-control.is-stop{color:#a3231c}.bench-focus-timer-control:disabled{opacity:.5;cursor:default}.bench-focus-stop-icon{font-size:.6rem}
.bench-focus-labor .bench-focus-paused-warning{color:#8a5a00;font-weight:700}.bench-unresolved-conflict{color:#8a5a00!important;font-weight:700}.bench-unresolved-actions button:disabled{opacity:.45;cursor:not-allowed}
.bench-focus-reminder-actions{display:flex;flex-wrap:wrap;gap:7px}.bench-focus-reminder-actions button,.bench-choice-actions button{min-height:34px;border:1px solid rgba(9,47,77,.16);border-radius:9px;background:#fffaf3;color:var(--navy);font:inherit;font-size:.72rem;font-weight:700;padding:5px 9px;cursor:pointer}
.bench-focus-reminder{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px;padding:7px 9px;border:1px solid rgba(195,138,25,.3);border-radius:9px;background:#fff8e7;color:#8a5a00;font-size:.7rem}.bench-focus-reminder[hidden]{display:none}.bench-focus-reminder button{min-height:30px;border:1px solid rgba(9,47,77,.16);border-radius:8px;background:#fffaf3;color:var(--navy);font:inherit;font-size:.68rem;font-weight:700;padding:4px 8px;cursor:pointer}
.bench-choice-sheet{position:fixed;inset:0;z-index:1300;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(9,47,77,.18);pointer-events:auto}.bench-choice-sheet[hidden]{display:none}.bench-choice-backdrop{position:fixed;inset:0;z-index:0;pointer-events:auto}.bench-choice-panel{position:relative;z-index:1;width:min(440px,100%);max-height:min(72vh,620px);overflow:auto;padding:16px;border:1px solid rgba(9,47,77,.16);border-radius:16px;background:#fffdf8;box-shadow:0 20px 50px rgba(9,47,77,.22);pointer-events:auto}.bench-choice-title{font-size:1rem;font-weight:750;color:var(--navy)}.bench-choice-panel p{margin:7px 0 12px;font-size:.8rem;color:rgba(9,47,77,.67)}.bench-choice-actions{display:flex;flex-direction:column;gap:7px;margin-top:12px}.bench-choice-actions button{text-align:left}.bench-choice-actions button.is-danger{color:#a3231c;border-color:rgba(179,38,30,.24)}
.bench-choice-sheet.is-anchored{display:block;padding:0;background:transparent}.bench-choice-sheet.is-anchored .bench-choice-panel{box-sizing:border-box;position:fixed;left:0;top:0;width:min(320px,calc(100vw - 24px));max-height:calc(100vh - 24px)}
.order-gallery-upload-fields{display:grid;gap:7px;margin-top:12px}.order-gallery-upload-fields label{font-size:.76rem;font-weight:700;color:var(--navy)}.order-gallery-upload-fields select,.order-gallery-upload-fields input{width:100%;box-sizing:border-box}.order-gallery-file-status{margin:0!important;font-size:.74rem!important}
.bench-unresolved-list{display:flex;flex-direction:column;gap:8px;margin-top:14px}.bench-unresolved-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px;border:1px solid rgba(9,47,77,.1);border-radius:11px;background:#fffaf3}.bench-unresolved-row>div:first-child{display:flex;min-width:0;flex-direction:column;gap:3px}.bench-unresolved-row strong{font-size:.8rem;color:var(--navy)}.bench-unresolved-row span{font-size:.7rem;color:rgba(9,47,77,.6)}.bench-unresolved-actions{display:flex;flex:0 0 auto;gap:6px}.bench-unresolved-actions button{min-height:44px;border:1px solid rgba(9,47,77,.15);border-radius:9px;background:#fffdf8;color:var(--navy);font:inherit;font-size:.72rem;font-weight:700;padding:7px 9px}.bench-unresolved-actions button.is-danger{color:#a3231c}
.bench-focus-start-btn,.bench-focus-end-btn,.bench-unresolved-indicator{min-height:44px;border:1px solid rgba(9,47,77,.16);border-radius:10px;background:#fffaf3;color:var(--navy);font:inherit;font-size:.74rem;font-weight:700;padding:7px 10px;cursor:pointer}
.dashboard-bench-actions .bench-focus-start-btn{box-sizing:border-box;min-height:32px;height:32px;max-width:none;padding:0 9px;font-size:.68rem;line-height:1;white-space:nowrap}
.bench-focus-start-btn:disabled{opacity:.55}.bench-focus-card .bench-focus-end-btn{min-width:0;min-height:34px;padding:5px 9px;font-size:.7rem;white-space:nowrap}.bench-unresolved-indicator{display:block;width:100%;margin:0 0 14px;text-align:left}
.bench-unresolved-indicator--medium{border-color:#c38a19;background:#fff8e7}.bench-unresolved-indicator--high{border-color:#b3261e;background:#fff0ed;color:#8e1f19}
@media (max-width:600px){.dashboard-bench-actions{align-items:center;flex-direction:row;flex-wrap:nowrap}.dashboard-bench-actions .bench-focus-start-btn{max-width:none;white-space:nowrap}.bench-focus-card-actions{align-items:stretch;flex-direction:column}.bench-focus-card .bench-focus-end-btn{align-self:flex-start}.bench-focus-reminder{align-items:flex-start;flex-direction:column}}
@media (max-width:500px){.bench-unresolved-row{align-items:stretch;flex-direction:column}.bench-unresolved-actions button{flex:1}}
.detail-bench-focus-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:10px 12px;border:1px solid rgba(9,47,77,.17);border-left:4px solid var(--navy);border-radius:11px;background:#fffaf3}.detail-bench-focus-banner>div{display:flex;min-width:0;flex-direction:column;gap:2px}.detail-bench-focus-banner span{font-size:.64rem;text-transform:uppercase;letter-spacing:.06em;color:rgba(9,47,77,.55)}.detail-bench-focus-banner strong{font-size:.78rem;color:var(--navy)}.detail-bench-focus-banner small{font-size:.68rem;color:rgba(9,47,77,.58)}.detail-bench-focus-actions{flex-direction:row!important;flex:0 0 auto;gap:6px!important}.detail-bench-focus-banner button{min-height:34px;border:1px solid rgba(9,47,77,.16);border-radius:9px;background:#fffdf8;color:var(--navy);font:inherit;font-size:.7rem;font-weight:700;padding:5px 9px;white-space:nowrap}
@media (max-width:600px){.detail-bench-focus-banner{align-items:flex-start;flex-direction:column}.detail-bench-focus-actions{width:100%;flex-wrap:wrap}.detail-bench-focus-banner button{width:auto}}

/* =========================
   USERS / ACCOUNTS SCREEN
   ========================= */
/* Match the other pages: full-width, left-aligned content under the topbar
   (not a centered column). Only the invite form is capped so it doesn't
   stretch. */
.users-shell{
  max-width:none;
  margin:0;
}

.users-loading{
  padding:14px;
}

.user-invite-card{
  display:grid;
  gap:10px;
  padding:14px;
  max-width:440px;
}

.user-invite-card input,
.user-invite-card select{
  width:100%;
  min-height:38px;
  border:1px solid rgba(9,47,77,.22);
  border-radius:10px;
  padding:8px 11px;
  font-size:.9rem;
  color:var(--navy);
  background:#fffdf8;
  outline:none;
}

.user-invite-card input:focus,
.user-invite-card select:focus{
  border-color:rgba(9,47,77,.4);
}

/* Custom caret so the role select matches the app's other dropdowns. */
.user-invite-card select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(9,47,77,.7) 50%),
    linear-gradient(135deg, rgba(9,47,77,.7) 50%, transparent 50%);
  background-position:calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-right:32px;
}

.user-invite-btn{
  justify-self:start;
  min-height:32px;
  padding:0 16px;
  border:none;
  border-radius:10px;
  background:var(--navy);
  color:var(--cream);
  font-weight:600;
  font-size:.85rem;
  cursor:pointer;
}

.user-invite-btn:active{
  transform:scale(.99);
}

.user-list{
  display:grid;
  gap:8px;
}

.user-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:11px 14px;
}

.user-row-main{
  min-width:0;
}

.user-row-title{
  color:var(--navy);
  font-weight:600;
  font-size:.92rem;
  line-height:1.2;
}

.user-row-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:3px;
  color:rgba(9,47,77,.6);
  font-size:.76rem;
}

.user-role-badge{
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:.62rem;
  font-weight:700;
  padding:2px 7px;
  border-radius:999px;
}

.user-role-admin{
  background:rgba(9,47,77,.12);
  color:var(--navy);
}

.user-role-demo{
  background:rgba(138,83,22,.14);
  color:#8a5316;
}

.user-flag{
  font-size:.68rem;
  font-weight:600;
  color:#8a5316;
}

.user-flag--off{
  color:#b3261e;
}

.user-row-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

/* Compact ghost buttons, in keeping with the app's other row actions. */
.user-action-btn{
  min-height:28px;
  padding:0 10px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:8px;
  background:transparent;
  color:var(--navy);
  font-size:.74rem;
  font-weight:600;
  cursor:pointer;
}

.user-action-btn:hover{
  background:rgba(9,47,77,.06);
}

.user-action-danger{
  color:#b3261e;
  border-color:rgba(179,38,30,.24);
}

.user-action-danger:hover{
  background:rgba(179,38,30,.06);
}

/* Demo-mode banner — a fixed pill so it never disturbs layout. */
/* Demo indicator lives in the sidebar brand — compact, non-obstructing,
   shown only for demo users via body.is-demo. */
.demo-badge{ display:none; }
body.is-demo .demo-badge{
  display:inline-block;
  margin-left:6px;
  padding:1px 7px;
  border-radius:999px;
  background:rgba(138,83,22,.16);
  color:#8a5316;
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.02em;
  vertical-align:middle;
}

/* =========================
   NOTIFICATION BADGES
   ========================= */
.nav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  margin-left:6px;
  padding:0 5px;
  border-radius:999px;
  background:#b3261e;
  color:#fff;
  font-size:.64rem;
  font-weight:700;
  line-height:1;
  vertical-align:middle;
}

.nav-badge[hidden]{
  display:none;
}

.topbar-menu-btn{
  position:relative;
}

body.has-notifications .topbar-menu-btn::after{
  content:"";
  position:absolute;
  top:7px;
  right:7px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#b3261e;
  border:1.5px solid var(--navy);
}

/* =========================
   MESSAGES / TWILIO INBOX
   ========================= */
.messages-shell{
  max-width:720px;
}

.msg-empty{
  padding:16px;
}

.msg-thread-list{
  display:grid;
  gap:8px;
}

.msg-thread{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  text-align:left;
  padding:11px 14px;
  cursor:pointer;
}

.msg-thread-main{
  min-width:0;
}

.msg-thread-title{
  color:var(--navy);
  font-weight:600;
  font-size:.92rem;
  line-height:1.2;
}

.msg-thread-order{
  color:rgba(9,47,77,.5);
  font-weight:600;
  font-size:.8rem;
}

.msg-thread-preview{
  font-size:.8rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:100%;
  margin-top:2px;
}

.msg-thread-meta{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:5px;
  flex:0 0 auto;
}

.msg-thread-time{
  font-size:.72rem;
}

.msg-unread-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#b3261e;
}

.msg-convo-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
}

.msg-back{
  border:none;
  background:none;
  color:var(--navy);
  font-weight:600;
  font-size:.9rem;
  cursor:pointer;
  padding:4px 2px;
  flex:0 0 auto;
}

.msg-convo-sub{
  font-size:.76rem;
  margin-top:2px;
}

.msg-convo{
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:calc(100dvh - 320px);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:6px 2px;
}

.msg-bubble{
  max-width:80%;
  padding:8px 11px;
  border-radius:14px;
  font-size:.9rem;
  line-height:1.3;
  word-break:break-word;
}

.msg-in{
  align-self:flex-start;
  background:#fffdf8;
  border:1px solid rgba(9,47,77,.12);
  color:var(--navy);
}

.msg-out{
  align-self:flex-end;
  background:var(--navy);
  color:var(--cream);
}

.msg-time{
  display:block;
  font-size:.6rem;
  opacity:.62;
  margin-top:3px;
}

.msg-media{
  display:inline-block;
  margin-top:4px;
  font-size:.8rem;
  text-decoration:underline;
}

.msg-reply{
  display:grid;
  gap:8px;
  margin-top:12px;
  max-width:720px;
}

.msg-reply textarea{
  width:100%;
  border:1px solid rgba(9,47,77,.22);
  border-radius:10px;
  padding:9px 11px;
  font-size:.9rem;
  color:var(--navy);
  background:#fffdf8;
  outline:none;
  resize:vertical;
}

.msg-reply-btn{
  justify-self:end;
  min-height:32px;
  padding:0 18px;
  border:none;
  border-radius:10px;
  background:var(--navy);
  color:var(--cream);
  font-weight:600;
  font-size:.85rem;
  cursor:pointer;
}

/* ---- Messages/notification refinements ---- */
.nav-badge{
  min-width:15px;
  height:15px;
  padding:0 4px;
  font-size:.56rem;
  line-height:1;
}

/* Mobile menu dot: no outline, just the dot. */
body.has-notifications .topbar-menu-btn::after{
  border:none;
}

/* Timestamp sits outside the bubble, toward the center of the viewer. */
.msg-line{
  display:flex;
  align-items:flex-end;
  gap:8px;
  max-width:90%;
}
.msg-line-in{ align-self:flex-start; }
.msg-line-out{ align-self:flex-end; flex-direction:row-reverse; }
.msg-line .msg-bubble{ max-width:100%; }
.msg-time{
  flex:0 0 auto;
  display:inline-block;
  margin:0;
  font-size:.6rem;
  opacity:.5;
  white-space:nowrap;
  color:var(--navy);
}

.msg-media-img{
  display:block;
  max-width:180px;
  border-radius:10px;
  margin-top:4px;
}

.msg-reply input{
  width:100%;
  border:1px solid rgba(9,47,77,.22);
  border-radius:10px;
  padding:9px 11px;
  font-size:.9rem;
  color:var(--navy);
  background:#fffdf8;
  outline:none;
}

/* ---- Native-messaging feel ---- */
.msg-avatar{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(9,47,77,.14);
  color:var(--navy);
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.02em;
}

.msg-day{
  align-self:center;
  margin:10px 0 2px;
  color:rgba(9,47,77,.45);
  font-size:.66rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.msg-bubble{
  border-radius:18px;
  padding:8px 12px;
}

.msg-line{ margin-bottom:2px; }
.msg-line.msg-tail{ margin-bottom:8px; }

/* iMessage-style tail on the last bubble of a run. */
.msg-line.msg-tail .msg-in{ border-bottom-left-radius:5px; }
.msg-line.msg-tail .msg-out{ border-bottom-right-radius:5px; }

/* Hide per-bubble time except on the tail bubble — cleaner runs. */
.msg-line:not(.msg-tail) .msg-time{ display:none; }

/* Sticky pill reply bar with circular send, like Messages. */
.msg-replybar{
  display:flex;
  align-items:flex-end;
  gap:8px;
  margin-top:10px;
  position:sticky;
  bottom:10px;
  background:var(--bg);
  padding:4px 0;
}

.msg-replybar textarea{
  flex:1 1 auto;
  border-radius:18px;
  min-height:36px;
  max-height:120px;
  padding:8px 14px;
  resize:none;
}

.msg-send-btn{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:none;
  border-radius:50%;
  background:var(--navy);
  color:var(--cream);
  font-size:1.05rem;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.msg-send-btn:active{ transform:scale(.94); }

/* ---- iOS PWA (standalone) safe areas ----
   black-translucent makes the webview cover the full screen, so content
   slid under the Dynamic Island and left matching dead space at the bottom.
   Pad the fixed chrome by the safe-area insets. */
@media (display-mode: standalone){
  .topbar,
  #detailView .detail-topbar{
    padding-top:calc(14px + env(safe-area-inset-top));
  }

  .side-menu{
    padding-top:calc(18px + env(safe-area-inset-top));
  }

  #loginView.active{
    padding-top:calc(16px + env(safe-area-inset-top));
  }
}

/* ---- Messages: left-align rows, swipe-to-delete, thread delete ---- */
.msg-thread-main{
  flex:1 1 auto;
  text-align:left;
}

.msg-swipe{
  position:relative;
  overflow:hidden;
  border-radius:14px;
}

.msg-swipe .msg-thread{
  position:relative;
  z-index:1;
  width:100%;
  transition:transform .18s ease;
}

.msg-swipe.is-open .msg-thread{
  transform:translateX(-88px);
}

.msg-swipe-del{
  position:absolute;
  top:0; right:0; bottom:0;
  width:88px;
  border:none;
  background:#b3261e;
  color:#fff;
  font-weight:600;
  font-size:.82rem;
  cursor:pointer;
}

.msg-convo-head{
  justify-content:flex-start;
}

.msg-convo-who{
  flex:1 1 auto;
  min-width:0;
}

.msg-del-btn{
  flex:0 0 auto;
  width:32px;
  height:32px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:8px;
  background:transparent;
  color:#b3261e;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.msg-del-btn svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* PWA standalone: html/body height:100% under-measures the full screen on
   iOS, leaving a gap below. Use 100dvh so the shell truly fills it. */
@media (display-mode: standalone){
  html, body, .app-shell{
    height:100dvh;
    min-height:100dvh;
  }
}

/* ---- Messages swipe: match the orders-list pattern (hidden until swiped,
   solid row bg so nothing bleeds through) ---- */
.msg-swipe .msg-thread{
  background:#fffaf3;
}

.msg-swipe-del{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity 120ms ease, visibility 0s linear 120ms;
}

.msg-swipe.is-open .msg-swipe-del{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:opacity 120ms ease, visibility 0s;
}

/* Desktop has no swipe — delete lives in the conversation header. */
@media (hover: hover) and (pointer: fine){
  .msg-swipe-del{ display:none; }
}

/* ---- iMessage-like inbox polish ---- */
.msg-thread{ padding:12px 14px; }
.msg-avatar{ width:40px; height:40px; font-size:.8rem; }
.msg-thread-title{ font-size:.95rem; }
.msg-thread-preview{ margin-top:3px; }
.msg-unread-dot{ background:#0a84ff; }

/* ---- PWA standalone: pin the shell to the real viewport so there is
   never dead space at the bottom (100% / dvh under-measure on iOS). ---- */
@media (display-mode: standalone){
  .app-shell{
    position:fixed;
    inset:0;
    height:auto;
    min-height:0;
  }

  .main-panel{
    height:100%;
    min-height:100%;
  }
}

/* ---- Desktop: keep button size, make the glyphs legible ---- */
@media (min-width: 900px){
  .topbar-icon-action svg{
    width:22px;
    height:22px;
    stroke-width:2.25;
  }
}

/* ---- iOS PWA bottom gap, definitive fix: lock html/body to the visual
   viewport (position:fixed) so iOS can't reserve phantom space below.
   The .main-panel is the only scroller, so fixing the body changes
   nothing else. ---- */
@media (display-mode: standalone){
  html{
    height:100%;
  }

  body{
    position:fixed;
    inset:0;
    width:100%;
    height:100%;
    overflow:hidden;
  }
}

/* ---- Standalone gap, root cause: in an installed PWA iOS under-reports
   dvh/% by the status-bar inset, so the 100dvh panel came up short at the
   bottom. There's no browser chrome in standalone, so plain 100vh is exact.
   Force vh for every layer of the height chain. ---- */
@media (display-mode: standalone){
  html,
  body,
  .app-shell{
    height:100vh;
    min-height:100vh;
  }

  .main-panel{
    height:100vh;
    min-height:100vh;
  }
}

/* ---- Mobile browser: scroll the document (not the inner panel) so
   Safari's toolbar minimizes on scroll like every normal page. Standalone
   PWA and desktop keep the inner scroller. ---- */
@media (max-width: 899px) and (display-mode: browser){
  html,
  body{
    height:auto;
    min-height:100%;
    overflow:visible;
  }

  .main-panel{
    height:auto;
    min-height:100dvh;
    overflow:visible;
  }
}

/* ---- Inbox restyle: one card, flat divided rows (matches Today's Bench) ---- */
.msg-inbox-card{
  padding:4px 12px;
}

.msg-swipe{
  border-radius:0;
  border-top:1px solid rgba(9,47,77,.08);
}

.msg-swipe:first-child{
  border-top:none;
}

.msg-thread{
  border:none;
  border-radius:0;
  box-shadow:none;
  background:#fffaf3;
  padding:9px 2px;
}

.msg-avatar{
  width:34px;
  height:34px;
  font-size:.72rem;
}

.msg-thread-title{
  font-size:.88rem;
}

.msg-thread-preview{
  font-size:.78rem;
}

/* ---- Conversation: closer to Apple Messages ---- */
.msg-day{
  margin:14px 0 4px;
  font-size:.7rem;
  font-weight:400;
  text-transform:none;
  letter-spacing:0;
  color:rgba(9,47,77,.5);
}

.msg-day strong{
  font-weight:600;
}

.msg-line{
  max-width:78%;
}

.msg-bubble{
  font-size:.85rem;
  line-height:1.35;
  padding:8px 12px;
  border-radius:18px;
}

.msg-in{
  background:rgba(9,47,77,.08);
  border:none;
}

.msg-line.msg-tail{
  margin-bottom:10px;
}

/* ---- Accounts list: flat divided rows in one card (matches Messages/Bench) ---- */
.user-list{
  display:block;
  padding:4px 12px;
}

.user-row{
  border:none;
  border-radius:0;
  box-shadow:none;
  background:transparent;
  border-top:1px solid rgba(9,47,77,.08);
  padding:10px 2px;
}

.user-row:first-child{
  border-top:none;
}

.user-row-title{
  font-size:.88rem;
}

/* ---- Account row ••• menu ---- */
.user-menu-wrap{
  position:relative;
}

.user-menu-btn{
  min-width:32px;
  font-size:1rem;
  line-height:1;
}

.user-menu-pop{
  top:calc(100% + 4px);
}

/* ---- Account rows: badge/flags inline with the name; plain ••• glyph ---- */
.user-row{
  flex-wrap:nowrap;
}

.user-row-title{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}

.user-row-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.user-menu-btn{
  border:none;
  background:transparent;
  box-shadow:none;
  color:rgba(9,47,77,.55);
  font-size:1.2rem;
  padding:0 4px;
  min-width:28px;
  min-height:28px;
}

.user-menu-btn:hover{
  background:rgba(9,47,77,.06);
  border:none;
}

/* ---- Invite form: compact to match the list below ---- */
.user-invite-card{
  gap:8px;
  padding:12px;
}

.user-invite-card input,
.user-invite-card select{
  min-height:32px;
  padding:6px 10px;
  font-size:.82rem;
  border-radius:9px;
}

.user-invite-card select{
  background-position:calc(100% - 15px) 13px, calc(100% - 10px) 13px;
  background-size:5px 5px, 5px 5px;
  padding-right:28px;
}

.user-invite-btn{
  min-height:30px;
  padding:0 14px;
  font-size:.8rem;
}

/* ---- Inbox: previews always truncate (never push the row wide) ---- */
.msg-swipe{ min-width:0; }
.msg-thread{ min-width:0; }
.msg-thread-main{ min-width:0; overflow:hidden; }
.msg-thread-preview{ display:block; }

/* Reply/compose input matches bubble text size */
.msg-reply textarea,
.msg-reply input{
  font-size:.85rem;
}

/* ---- Mobile browser: the conversation flows in the document (no inner
   scroller, no sticky reply bar) so tapping the input gets normal iOS
   keyboard behavior — no over-scroll past the keyboard, no dead space. ---- */
@media (max-width: 899px) and (display-mode: browser){
  .msg-convo{
    max-height:none;
    overflow:visible;
  }

  .msg-replybar{
    position:static;
  }
}

/* ---- Root cause of inbox overflow: .dashboard-shell is a grid, and grid
   children default to min-width:auto, so the inbox card stretched past the
   viewport regardless of the preview's own truncation (dragging the page
   into horizontal scroll — the "scroll chaos"). Clamp the chain. ---- */
.messages-shell{
  min-width:0;
  max-width:100%;
}

.messages-shell > *{
  min-width:0;
  max-width:100%;
}

/* ---- Conversation viewport-fit: the earlier document-flow experiment let
   the keyboard scroll the page (header lost). Back to an inner scroller in
   every mode; JS sizes it to the visual viewport so the input sits right
   above the keyboard and the header never moves. ---- */
@media (max-width: 899px) and (display-mode: browser){
  .msg-convo{
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }

  .msg-replybar{
    position:sticky;
    bottom:10px;
  }
}

/* Invite form: smaller still */
.user-invite-card input,
.user-invite-card select{
  font-size:.78rem;
  min-height:30px;
  padding:5px 9px;
}

.user-invite-card select{
  background-position:calc(100% - 14px) 12px, calc(100% - 9px) 12px;
}

/* ---- Attach-photo button in the reply bar ---- */
.msg-attach-btn{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:none;
  border-radius:50%;
  background:rgba(9,47,77,.08);
  color:var(--navy);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.msg-attach-btn svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.msg-attach-btn.has-photo{
  background:var(--navy);
  color:var(--cream);
}

/* ---- iOS-style media messages ---- */
.msg-bubble.msg-media-only{
  background:transparent;
  border:none;
  padding:0;
}

.msg-media-img{
  max-width:220px;
  max-height:280px;
  border-radius:16px;
  margin-top:0;
  display:block;
}

.msg-bubble:not(.msg-media-only) .msg-media-img{
  margin-top:6px;
  border-radius:12px;
}

/* Attachment preview above the input, thumbnail with ✕ (like iOS) */
.msg-attach-preview{
  display:flex;
  padding:6px 2px 0;
}

.msg-attach-thumb{
  position:relative;
  display:inline-block;
}

.msg-attach-thumb img{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:12px;
  display:block;
}

.msg-attach-remove{
  position:absolute;
  top:-6px;
  right:-6px;
  width:20px;
  height:20px;
  border:none;
  border-radius:50%;
  background:rgba(9,47,77,.85);
  color:#fff;
  font-size:.6rem;
  line-height:1;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

/* Tighter gap between messages and the reply bar */
.msg-replybar{
  margin-top:4px;
  padding:2px 0;
  bottom:6px;
}

.msg-convo{
  padding-bottom:2px;
}

/* ---- Conversation screen: flex column pinned to the visual viewport.
   The message list flex-fills between header and reply bar, so the input
   is always exactly above the keyboard — no height arithmetic. ---- */
.msg-convo-shell{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:0;
}

.msg-convo-shell .msg-convo{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.msg-convo-shell .msg-replybar{
  position:static;
  margin-top:0;
}

.msg-convo-shell .msg-convo-head{
  margin-bottom:0;
}

/* Bubbles render exactly what was sent: preserve the SMS line breaks. */
.msg-bubble{
  white-space:pre-wrap;
}

/* Desktop: cap bubble width like a real messenger instead of 78% of a wide panel */
@media (min-width: 900px){
  .msg-line{ max-width:480px; }
}

/* Desktop text scale: 10% smaller everywhere — the "Safari 90% zoom" look.
   All admin font-sizes are rem-based, so shrinking the root does the whole job.
   body was 14px on desktop; 0.875rem keeps the same ratio (12.6px effective). */
@media (min-width: 900px){
  html{ font-size:90%; }
  body{ font-size:0.875rem; }
}

/* Linked-order pill in the gallery manager */
.gallery-linked-pill{
  background:rgba(9,47,77,.12);
  color:var(--navy);
}

/* Shop-glove describe dialog (gallery manager) */
.gallery-describe-overlay{
  position:fixed;
  inset:0;
  z-index:1200;
  background:rgba(2,11,18,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.gallery-describe-card{
  width:min(360px, 100%);
  background:#fffaf3;
  border-radius:14px;
  padding:16px;
  box-shadow:0 18px 50px rgba(2,11,18,.3);
}
.gallery-describe-card h3{
  margin:0 0 4px;
  font-size:1rem;
  color:var(--navy);
}
.gallery-describe-card p{
  margin:0 0 12px;
  font-size:.8rem;
  color:rgba(2,11,18,.6);
}
.gallery-describe-card label{
  display:flex;
  flex-direction:column;
  gap:3px;
  font-size:.75rem;
  font-weight:600;
  color:var(--navy);
  margin-bottom:8px;
}
.gallery-describe-card input,
.gallery-describe-card select{
  font-size:.85rem;
  padding:7px 10px;
  border:1px solid rgba(9,47,77,.24);
  border-radius:8px;
  background:#fff;
  font-family:inherit;
  color:inherit;
}
.gallery-describe-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
}
.gallery-describe-spacer{ flex:1; }
.gallery-describe-actions button{
  min-height:32px;
  padding:4px 12px;
  border-radius:8px;
  border:1px solid rgba(9,47,77,.24);
  background:#fff;
  color:var(--navy);
  font-size:.8rem;
  cursor:pointer;
}
.gallery-describe-actions .gallery-describe-save{
  background:var(--navy);
  color:#fff;
  border-color:var(--navy);
}
.gallery-describe-actions .gallery-describe-remove{
  border-color:rgba(146,26,36,.4);
  color:#921a24;
}

/* Describe dialog: brand/model autofill suggestions from past work */
.gallery-describe-suggest-wrap{
  position:relative;
  display:block;
}
.gallery-describe-suggest{
  position:absolute;
  top:calc(100% + 2px);
  left:0;
  right:0;
  z-index:5;
  background:#fff;
  border:1px solid rgba(9,47,77,.2);
  border-radius:10px;
  box-shadow:0 10px 30px rgba(2,11,18,.18);
  overflow:hidden;
}
.gallery-describe-suggest button{
  display:flex;
  flex-direction:column;
  gap:1px;
  width:100%;
  padding:8px 10px;
  border:0;
  background:none;
  text-align:left;
  cursor:pointer;
}
.gallery-describe-suggest button:hover{
  background:rgba(9,47,77,.06);
}
.gallery-describe-suggest strong{
  font-size:.8rem;
  color:var(--navy);
  font-weight:600;
}
.gallery-describe-suggest span{
  font-size:.7rem;
  color:rgba(2,11,18,.55);
}

/* Drag & drop over photo uploaders: highlight the active drop zone */
.photo-drop-active{
  outline:2px dashed var(--navy);
  outline-offset:3px;
  border-radius:12px;
  background:rgba(9,47,77,.06);
}

/* Gallery manager cleanup: cover star on the thumb, compact search field */
.gallery-manager-thumb{
  position:relative;
}
.gallery-cover-star{
  position:absolute;
  top:4px;
  left:4px;
  width:17px;
  height:17px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:rgba(255,255,255,.92);
  color:#c9962e;
  font-size:10px;
  line-height:1;
  box-shadow:0 1px 3px rgba(9,47,77,.25);
}
.gallery-manager-search{
  max-width:150px;
}
/* Move-to-section chooser buttons */
.gallery-move-options{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.gallery-move-options button{
  min-height:34px;
  padding:6px 12px;
  border-radius:8px;
  border:1px solid rgba(9,47,77,.24);
  background:#fff;
  color:var(--navy);
  font-size:.85rem;
  text-align:left;
  cursor:pointer;
}
.gallery-move-options button:hover{
  background:rgba(9,47,77,.06);
}

/* Gallery manager search: compact — 16px floor prevents iOS focus zoom. */
.gallery-manager-search{
  box-sizing:border-box;
  font-size:16px;
  height:34px;
  min-height:34px;
  padding:0 10px;
  line-height:1.3;
}
.gallery-manager-search::placeholder{
  font-size:0.85em;
}
.gallery-manager-filter{
  font-size:.84rem!important;
}
@media (min-width:900px){
  .gallery-manager-search{
    font-size:.82rem;
    font-weight:600;
  }
}

/* ---- Shop-glove grouping: gallery manager multi-select ---- */
.gallery-manager-select-btn{
  flex:0 0 auto;
}
.gallery-select-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  margin:8px 0 0;
  padding:8px 10px;
  border-radius:10px;
  background:#fffaf3;
  border:1px solid rgba(9,47,77,.14);
}
.gallery-select-bar[hidden]{ display:none; }
.gallery-select-count{
  font-size:.8rem;
  font-weight:600;
  color:var(--navy);
}
.gallery-select-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
/* Narrow screens: stack the count over the actions so the buttons never run
   off the edge (no horizontal overflow). */
@media (max-width:560px){
  .gallery-select-bar{
    flex-direction:column;
    align-items:stretch;
  }
}
/* Full-card tap target in select mode: sits above the thumb + action select
   so the whole card toggles selection without hijacking their handlers. */
.gallery-manager-item{ position:relative; }
.gallery-select-overlay{
  position:absolute;
  inset:0;
  z-index:6;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  border-radius:inherit;
  cursor:pointer;
}
.gallery-select-check{
  position:absolute;
  top:6px;
  left:6px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  border:2px solid var(--navy);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:700;
  line-height:1;
  color:var(--navy);
  box-shadow:0 1px 3px rgba(9,47,77,.25);
}
.gallery-manager-item.is-selected{
  outline:2px solid var(--navy);
  outline-offset:-2px;
}
.gallery-manager-item.is-selected .gallery-select-check{
  background:var(--navy);
  color:#fff;
}
/* While selecting, the per-card action dropdown is hidden — the card is a toggle. */
.gallery-manager-grid.is-selecting .gallery-manager-action-select{
  display:none;
}

/* Gallery photo action menu: compact. Scoped to gallery-photo-menu-root so
   the orders workflow sheet keeps its own sizing. */
.gallery-photo-menu-root .workflow-sheet{
  max-width:250px;
}
.gallery-photo-menu-root .workflow-action-btn{
  min-height:34px;
  padding:7px 12px;
  font-size:0.85rem;
}

/* Brand text keeps Montserrat; everything else runs on the system font
   (SF on Apple devices) — tighter, sleeker, no webfont needed for UI. */
.brand-title,
.brand-subtitle{
  font-family:'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Mobile: one notch smaller everywhere — the system font's tighter forms
   afford it. (Desktop already runs a 90% root further up; rem-based sizes
   scale from the root, px-based anti-zoom rules are unaffected.) */
@media (max-width: 899px){
  html{ font-size:95%; }
  /* stay >=16px real pixels so iOS doesn't zoom when the login focuses */
  .login-card input{ font-size:16px; }
}

/* =========================
   Customer Profiles (Phase 1.2) — compact, iOS-list feel
========================= */
.customers-card{
  padding:12px 14px;
}

.customers-search{
  width:100%;
  font-size:16px;
  padding:7px 10px;
  min-height:0;
  line-height:1.3;
  border:1px solid rgba(9,47,77,.24);
  border-radius:10px;
  background:#fff;
  margin-bottom:10px;
}
.customers-search::placeholder{ font-size:.85em; }

.customers-list,
.customer-orders{
  display:flex;
  flex-direction:column;
}
.customer-row,
.customer-order-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  min-height:44px;
  padding:8px 2px;
  border:0;
  border-bottom:1px solid rgba(9,47,77,.10);
  background:none;
  text-align:left;
  cursor:pointer;
}
.customer-row:last-child,
.customer-order-row:last-child{ border-bottom:0; }
.customer-row-main{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.customer-row-name{
  font-size:.9rem;
  font-weight:600;
  color:var(--navy);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-row-sub{
  font-size:.75rem;
  color:rgba(2,11,18,.55);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-row-side{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.customer-row-spend{
  font-size:.85rem;
  font-weight:600;
  color:var(--navy);
  font-variant-numeric:tabular-nums;
}
.customer-row-chevron{
  color:rgba(9,47,77,.35);
  font-size:1.1rem;
}
.customers-empty{ padding:12px 2px; }

.customer-back{
  border:0;
  background:none;
  color:var(--navy);
  font-size:.85rem;
  font-weight:600;
  padding:0 0 10px;
  cursor:pointer;
}
.customer-profile-name{
  margin:0 0 6px;
  font-size:1.15rem;
  color:var(--navy);
}
.customer-contact{
  margin:0 0 12px;
  font-size:.8rem;
  color:rgba(2,11,18,.6);
}
.customer-contact-link{
  color:var(--navy);
  font-weight:600;
  text-decoration:none;
}
.customer-contact-sep{ color:rgba(2,11,18,.35); }
.customer-no-contact{ margin:0 0 12px; font-size:.8rem; }

.customer-stats{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}
.customer-stat{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:70px;
  padding:8px 12px;
  border:1px solid rgba(9,47,77,.12);
  border-radius:10px;
  background:rgba(9,47,77,.03);
}
.customer-stat-value{
  font-size:.95rem;
  font-weight:700;
  color:var(--navy);
  font-variant-numeric:tabular-nums;
}
.customer-stat-lace{ font-size:.85rem; }
.customer-stat-label{
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:rgba(2,11,18,.5);
}

.customer-photo-strip{
  display:flex;
  gap:6px;
  overflow-x:auto;
  padding-bottom:6px;
  margin-bottom:10px;
  -webkit-overflow-scrolling:touch;
}
.customer-photo{
  flex:0 0 auto;
  width:56px;
  height:56px;
  padding:0;
  border:0;
  background:none;
  cursor:pointer;
}
.customer-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:8px;
}

.customer-profile-link{
  margin-top:4px;
}

/* =========================
   Calendar (Phase 1.3) — compact iOS month grid + day agenda
========================= */
.cal-card{ padding:12px 14px; }
.cal-agenda-card{ padding:10px 14px; }

.cal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.cal-title{
  font-size:.95rem;
  font-weight:700;
  color:var(--navy);
}
.cal-header-right{
  display:flex;
  align-items:center;
  gap:6px;
}
.cal-nav-btn,
.cal-today-btn{
  min-height:30px;
  padding:2px 10px;
  border:1px solid rgba(9,47,77,.2);
  border-radius:8px;
  background:#fff;
  color:var(--navy);
  font-size:.85rem;
  cursor:pointer;
}
.cal-today-btn{ font-size:.75rem; font-weight:600; }

.cal-weekdays{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:2px;
  margin-bottom:2px;
}
.cal-weekdays span{
  text-align:center;
  font-size:.62rem;
  font-weight:600;
  letter-spacing:.04em;
  color:rgba(2,11,18,.45);
}

.cal-grid{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:2px;
}
.cal-day{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  min-height:44px;
  padding:4px 2px;
  border:0;
  border-radius:8px;
  background:none;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.cal-day:hover{ background:rgba(9,47,77,.05); }
.cal-day-num{
  font-size:.78rem;
  font-weight:600;
  color:var(--navy);
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
}
.cal-day.is-other .cal-day-num{ color:rgba(2,11,18,.28); font-weight:400; }
.cal-day.is-today .cal-day-num{ background:rgba(9,47,77,.12); }
.cal-day.is-selected .cal-day-num{ background:var(--navy); color:#fff; }

.cal-dots{
  display:flex;
  gap:2px;
}
.cal-dot{
  width:5px;
  height:5px;
  border-radius:50%;
  display:inline-block;
}
.cal-dot-due{ background:var(--navy); }
.cal-dot-overdue{ background:#921a24; }
.cal-dot-arriving{ background:#c98a1f; }
.cal-dot-done{ background:rgba(30,107,52,.55); }

.cal-legend{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
  font-size:.66rem;
  color:rgba(2,11,18,.55);
}
.cal-legend > span{
  display:inline-flex;
  align-items:center;
  gap:4px;
}

.cal-agenda-title{
  font-size:.85rem;
  font-weight:700;
  color:var(--navy);
  padding:2px 0 4px;
}
.cal-agenda-empty{ padding:8px 0; font-size:.8rem; }

.cal-tag{
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.03em;
  text-transform:uppercase;
  padding:2px 7px;
  border-radius:999px;
}
.cal-tag-due{ background:rgba(9,47,77,.1); color:var(--navy); }
.cal-tag-overdue{ background:rgba(146,26,36,.12); color:#921a24; }
.cal-tag-arriving{ background:rgba(201,138,31,.14); color:#8a6116; }
.cal-tag-done{ background:rgba(30,107,52,.12); color:#1e6b34; }

/* Calendar: Ready to Go — finished work awaiting pickup, its own bucket */
.cal-dot-ready{ background:#1e6b34; }
.cal-tag-ready{ background:rgba(30,107,52,.16); color:#1e6b34; }

/* Calendar: clickable "active without a date" topbar count + its agenda tag */
.cal-undated-link{
  border:0;
  background:none;
  padding:0;
  font:inherit;
  color:inherit;
  text-decoration:underline;
  text-underline-offset:2px;
  cursor:pointer;
}
.cal-tag-undated{ background:rgba(2,11,18,.08); color:rgba(2,11,18,.6); }

/* Measured pricing (2.1): suggestion basis line + bucket status tags */
.order-economics-basis{
  font-size:.68rem;
  color:rgba(2,11,18,.45);
  margin-top:1px;
}
.measured-tag{
  font-size:.65rem;
  font-weight:600;
  padding:2px 8px;
  border-radius:999px;
  background:rgba(2,11,18,.07);
  color:rgba(2,11,18,.55);
  white-space:nowrap;
}
.measured-tag-live{
  background:rgba(30,107,52,.12);
  color:#1e6b34;
}

/* Promise engine (2.2): proposed completion date under the date field */
.promise-proposal{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:5px;
}
.promise-text{
  font-size:.7rem;
  color:rgba(2,11,18,.55);
  line-height:1.4;
}
.promise-text strong{ color:var(--navy); }
/* Size + visual language come from the shared compact .secondary base; this
   only keeps the button from shrinking next to the promise text. */
.promise-apply-btn{
  flex-shrink:0;
}

/* Expenses (2.4) — compact entry row + list */
.expense-summary{
  font-size:.78rem;
  color:rgba(2,11,18,.6);
  margin-bottom:10px;
}
.expense-summary strong{ color:var(--navy); }
.expense-form{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:6px;
}
/* Same skin as every other admin field (detail-block recipe) */
.expense-form input,
.expense-form select{
  min-height:40px;
  padding:8px 11px;
  font-size:.92rem;
  font-weight:500;
  line-height:1.2;
  border:1px solid rgba(9,47,77,.16);
  border-radius:14px;
  background:#fffaf3;
  color:var(--navy);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.expense-form input::placeholder{ color:rgba(9,47,77,.45); }
#expenseDescription{ flex:1 1 140px; min-width:120px; }
#expenseAmount{ width:84px; }
#expenseQuantity{ width:64px; }
.expense-add-btn{
  min-height:32px;
  padding:4px 14px;
  font-size:.8rem;
}
.expense-status{ font-size:.72rem; min-height:1em; margin:0 0 6px; }
.expense-status:empty{ display:none; }
.expense-delete-btn{
  border:0;
  background:none;
  color:#921a24;
  font-size:.95rem;
  cursor:pointer;
  padding:0 4px;
}

@media (max-width: 899px){
  /* iOS focus-zoom floor */
  .expense-form input,
  .expense-form select{ font-size:16px; }
}

/* Monthly P&L: profit column carries the verdict */
.pnl-positive{ font-weight:600; color:#1e6b34; }
.pnl-negative{ font-weight:600; color:#921a24; }

/* Glove service records (3.1) — per-glove history inside the profile */
.glove-record{
  padding-top:12px;
  margin-top:12px;
  border-top:1px solid rgba(9,47,77,.12);
}
.glove-record-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.glove-record-name{
  font-size:.9rem;
  font-weight:700;
  color:var(--navy);
}
.glove-record-type{
  font-weight:500;
  color:rgba(2,11,18,.5);
  font-size:.78rem;
}
.glove-record-meta{
  font-size:.7rem;
  color:rgba(2,11,18,.5);
  white-space:nowrap;
}

/* Maintenance reminders (3.3): due list above the customer list */
.maintenance-card{ margin-bottom:10px; }
.maintenance-row{ cursor:default; }
.maintenance-open{
  border:0;
  background:none;
  text-align:left;
  padding:0;
  cursor:pointer;
  min-width:0;
}
.maintenance-text-btn{
  min-height:28px;
  padding:3px 14px;
  font-size:.75rem;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  border-radius:8px;
}

/* Reach chips (4.3) */
.reach-chips{display:flex; flex-wrap:wrap; gap:6px}
.reach-chip{font-size:.72rem; padding:3px 10px; border-radius:999px; background:rgba(9,47,77,.07); color:var(--navy)}
.reach-chip b{font-weight:700}

/* Suggested price hint under the Price Quoted field (Order Detail) */
.price-suggest-hint{
  font-size:.72rem;
  color:rgba(2,11,18,.5);
  margin-top:5px;
}

/* Message text is selectable — copy a tracking number without deleting the message */
.msg-line, .msg-bubble{
  -webkit-user-select: text;
  user-select: text;
}

/* =========================================================================
   PRICING MANAGEMENT (Pricing view) — scoped, appended. Reuses the shared
   .dashboard-card / .dashboard-metric / .money-card language.
   Pricing renders into #pricingPanel (.money-view > .money-panel) — the exact
   Money-view wrapper — so header, gutters, width, and spacing match Money.
   ========================================================================= */
.pricing-group{display:grid; gap:8px}
.pricing-group-title{margin:6px 2px 0}

.pricing-settings-card{display:grid; gap:10px; padding:12px}
.pricing-settings-note{margin:0; font-size:.72rem; line-height:1.35}
.pricing-settings-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}

.pricing-field{display:grid; gap:5px; min-width:0}
.pricing-field-wide{grid-column:1 / -1}
.pricing-field-label{
  font-size:.7rem;
  font-weight:600;
  color:rgba(9,47,77,.62);
  line-height:1.25;
}
.pricing-field input[type="text"],
.pricing-field input[type="number"],
.pricing-field select,
.pricing-field textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid rgba(9,47,77,.16);
  border-radius:10px;
  background:#fffdf9;
  padding:8px 10px;
  font:inherit;
  font-size:.82rem;
  color:var(--ink);
}
.pricing-field textarea{resize:vertical; line-height:1.4; min-height:96px}
.pricing-field input:focus,
.pricing-field select:focus,
.pricing-field textarea:focus{
  outline:none;
  border-color:rgba(9,47,77,.4);
  box-shadow:0 0 0 3px rgba(9,47,77,.08);
}

.pricing-actions{display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.pricing-actions button{min-height:34px; border-radius:10px; padding:0 14px; font-size:.8rem}
.pricing-publish{
  background:var(--navy);
  color:#fffaf3;
  border:1px solid var(--navy);
  font-weight:600;
  cursor:pointer;
}
.pricing-publish:hover{background:#0b3a5f}
.pricing-danger{color:var(--red); border-color:rgba(146,26,36,.3)}

/* Service cards */
.pricing-card{padding:10px 12px 11px; display:grid; gap:7px}
.pricing-card.is-expanded{box-shadow:0 10px 26px rgba(9,47,77,.10)}
.pricing-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  background:none;
  border:0;
  padding:0;
  font:inherit;
  color:inherit;
  cursor:pointer;
  text-align:left;
}
.pricing-card-headmain{display:grid; gap:2px; min-width:0}
.pricing-card-name{
  font-size:.92rem;
  font-weight:620;
  color:var(--navy);
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pricing-card-meta{font-size:.68rem; color:rgba(9,47,77,.55)}
.pricing-card-headside{display:flex; align-items:center; gap:8px; flex-shrink:0}
.pricing-card-price{
  font-size:.9rem;
  font-weight:650;
  color:var(--navy);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.pricing-card-draftprice{
  font-size:.74rem;
  color:var(--red);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.pricing-card-chevron{color:rgba(9,47,77,.5); font-size:.8rem}
.pricing-card-pills{display:flex; flex-wrap:wrap; align-items:center; gap:6px}
.pricing-card-suggest{font-size:.68rem; margin-left:auto}

.pricing-pill{
  font-size:.66rem;
  font-weight:600;
  padding:2px 8px;
  border-radius:999px;
  line-height:1.5;
  white-space:nowrap;
}
.pricing-pill-good{background:rgba(62,155,99,.14); color:#2f7d4f}
.pricing-pill-warn{background:rgba(146,26,36,.12); color:var(--red)}
.pricing-pill-neutral{background:rgba(9,47,77,.09); color:var(--navy)}
.pricing-pill-muted{background:rgba(9,47,77,.06); color:rgba(9,47,77,.55)}

/* Editor */
.pricing-editor{display:grid; gap:10px; padding-top:6px; border-top:1px solid rgba(9,47,77,.1)}

/* Editor sections — Price & Status is always open; the rest are collapsible. */
.pricing-section{
  border:1px solid rgba(9,47,77,.1);
  border-radius:12px;
  background:rgba(255,253,249,.55);
  overflow:hidden;
}
.pricing-section-open{padding:11px 12px; display:grid; gap:10px}
.pricing-section-title{
  font-size:.72rem; font-weight:650; letter-spacing:.03em; text-transform:uppercase;
  color:rgba(9,47,77,.6);
}
.pricing-section-summary{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; cursor:pointer; list-style:none;
  font-size:.82rem; font-weight:600; color:var(--navy);
}
.pricing-section-summary::-webkit-details-marker{display:none}
.pricing-section-summary::before{content:"▸"; color:rgba(9,47,77,.5); font-size:.7rem}
details.pricing-section[open] > .pricing-section-summary::before{content:"▾"}
details.pricing-section[open] > .pricing-section-summary{border-bottom:1px solid rgba(9,47,77,.08)}
.pricing-section-body{padding:11px 12px; display:grid; gap:12px; min-width:0}
/* The section already provides the container chrome — flatten the inner block. */
.pricing-section-body > .pricing-intel{border:0; border-radius:0; background:transparent; padding:0}
.pricing-editor-note{margin-top:2px}

.pricing-editor-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}
.pricing-toggles{display:flex; flex-wrap:wrap; gap:14px; align-items:center}
.pricing-toggle{display:flex; align-items:center; gap:7px; font-size:.78rem; color:var(--ink)}
.pricing-toggle input{width:16px; height:16px}

.pricing-preview{
  border:1px dashed rgba(9,47,77,.2);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,253,249,.7);
  display:grid;
  gap:6px;
}
.pricing-preview-label{font-size:.66rem; font-weight:600; color:rgba(9,47,77,.5); text-transform:uppercase; letter-spacing:.04em}
.pricing-preview-item{display:grid; gap:6px}
.pricing-preview-heading{display:flex; align-items:baseline; justify-content:space-between; gap:12px}
.pricing-preview-heading h4{margin:0; font-size:.9rem; color:var(--navy)}
.pricing-preview-price{font-size:.82rem; font-weight:620; color:var(--navy); white-space:nowrap; font-variant-numeric:tabular-nums}
.pricing-preview-item ul{margin:0; padding-left:1.1em; display:grid; gap:2px}
.pricing-preview-item li{font-size:.74rem; color:var(--muted); line-height:1.35}

/* Intelligence */
.pricing-intel{
  border:1px solid rgba(9,47,77,.1);
  border-radius:12px;
  padding:11px 12px;
  background:rgba(248,239,223,.4);
  display:grid;
  gap:8px;
}
.pricing-intel-head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.pricing-intel-title{font-size:.78rem; font-weight:650; color:var(--navy)}
.pricing-intel-grid{
  margin:0;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:6px 14px;
}
.pricing-intel-row{display:flex; align-items:baseline; justify-content:space-between; gap:10px; min-width:0}
.pricing-intel-row dt{font-size:.72rem; color:rgba(9,47,77,.6)}
.pricing-intel-row dd{margin:0; font-size:.76rem; font-weight:600; color:var(--navy); font-variant-numeric:tabular-nums; text-align:right}
.pricing-intel-note{margin:0; font-size:.72rem; line-height:1.4}
/* Per-tier blocks: standard and premium are visually separated */
.pricing-intel-tier{display:grid; gap:8px}
.pricing-intel-tier + .pricing-intel-tier{padding-top:10px; border-top:1px dashed rgba(9,47,77,.16)}
.pricing-intel-tiernote{font-weight:600; color:rgba(9,47,77,.6)}

/* History */
.pricing-history{padding-top:2px}
.pricing-link{
  background:none;
  border:0;
  padding:0;
  font:inherit;
  font-size:.74rem;
  font-weight:600;
  color:var(--navy);
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}
.pricing-history-list{display:grid; gap:8px}
.pricing-history-title{font-size:.72rem; font-weight:650; color:rgba(9,47,77,.6); text-transform:uppercase; letter-spacing:.03em}
.pricing-history-row{
  display:grid;
  gap:2px;
  padding:7px 0;
  border-top:1px solid rgba(9,47,77,.08);
}
.pricing-history-main{display:flex; align-items:baseline; justify-content:space-between; gap:10px}
.pricing-history-change{font-size:.78rem; font-weight:600; color:var(--navy); font-variant-numeric:tabular-nums}
.pricing-history-date{font-size:.7rem}
.pricing-history-note{font-size:.72rem}
.pricing-history-empty{font-size:.74rem; margin:0}

.pricing-create-toggle{display:flex; justify-content:center; padding:4px 0 10px}
.pricing-create-card{display:grid; gap:10px; padding:12px}

/* Clickable measured-jobs count (links to the exact orders behind it) */
.pricing-jobs-link{
  background:none; border:0; padding:0; font:inherit;
  color:var(--navy); font-weight:600; font-variant-numeric:tabular-nums;
  cursor:pointer; text-decoration:underline; text-underline-offset:2px;
  text-decoration-color:rgba(9,47,77,.4);
}
.pricing-jobs-link:hover{text-decoration-color:var(--navy)}
/* Smaller inline sample-count links next to each metric value */
.pricing-jobs-link--sub{font-size:.66rem; font-weight:400}
.pricing-intel-samples{white-space:nowrap}

/* Removable "Pricing Intelligence" filter chip above the Orders list —
   compact, matching the standard MurphOS chip (.reach-chip) sizing. */
.pricing-chip-row{display:flex; flex-wrap:wrap; gap:6px; padding:8px 14px 10px}
.pricing-chip-row[hidden]{display:none}
.pricing-chip{
  display:inline-flex; align-items:center; gap:6px; max-width:100%;
  padding:3px 4px 3px 10px; border-radius:999px;
  background:rgba(9,47,77,.07); color:var(--navy);
  font-size:.72rem; font-weight:550; line-height:1.5;
}
.pricing-chip-label{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pricing-chip-remove{
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:50%; flex:0 0 auto;
  border:0; background:rgba(9,47,77,.12); color:var(--navy);
  font-size:.8rem; line-height:1; cursor:pointer;
}
.pricing-chip-remove:hover{background:rgba(9,47,77,.2)}

/* Small muted qualifier inside an intel value (e.g. "· 5 paid") */
.pricing-intel-sub{font-size:.66rem; font-weight:400}

/* Preview environment badge — only injected in non-production deployments */
.mm-preview-badge{
  position:fixed;
  bottom:calc(12px + env(safe-area-inset-bottom, 0px));
  left:50%;
  transform:translateX(-50%);
  z-index:99999;
  padding:5px 14px;
  border-radius:999px;
  background:var(--red);
  color:#fff;
  font-size:.64rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  box-shadow:0 6px 18px rgba(146,26,36,.35);
  pointer-events:none;
  user-select:none;
}

/* Money view — Service Pricing Intelligence card */
.pricing-money-note{margin:0; font-size:.72rem; line-height:1.35}
.pricing-money-list{display:grid; gap:6px}
.pricing-money-item{
  border:1px solid rgba(9,47,77,.1);
  border-radius:12px;
  background:rgba(255,253,249,.7);
  overflow:hidden;
}
.pricing-money-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 11px;
  cursor:pointer;
  list-style:none;
}
.pricing-money-summary::-webkit-details-marker{display:none}
.pricing-money-name{font-size:.82rem; font-weight:600; color:var(--navy); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pricing-money-side{display:flex; align-items:center; gap:8px; flex-shrink:0}
.pricing-money-price{font-size:.82rem; font-weight:650; color:var(--navy); font-variant-numeric:tabular-nums; white-space:nowrap}
.pricing-money-rate{font-size:.7rem; font-variant-numeric:tabular-nums}
.pricing-money-item[open] .pricing-money-summary{border-bottom:1px solid rgba(9,47,77,.08)}
.pricing-money-item .pricing-intel{border:0; border-radius:0; background:transparent; padding:10px 11px}
@media (max-width:520px){
  .pricing-money-rate{display:none}
}

@media (max-width:520px){
  .pricing-card-name{white-space:normal}
  .pricing-intel-row dd{text-align:right}
}

/* Phones: stack every pricing grid to one column so long labels never clip or
   force horizontal overflow. Tablets/desktop keep the multi-column layout. */
@media (max-width:560px){
  /* Editor + intel grids carry long labels — stack to one column on phones so
     nothing clips. (Settings grid keeps its existing layout: short labels.) */
  .pricing-editor-grid,
  .pricing-intel-grid{
    grid-template-columns:1fr;
  }
  /* Stack the tier label above its status pill so long labels never get
     squeezed beside a wide pill. */
  .pricing-intel-head{flex-direction:column; align-items:flex-start; gap:4px}
}
/* =========================================================================
   REVIEWS MANAGEMENT — scoped to the Reviews view. Reuses the same
   .money-view / .money-panel / .dashboard-card language as Pricing.
   ========================================================================= */
.reviews-admin-panel{width:100%;min-width:0;box-sizing:border-box}
.reviews-admin-panel>*{min-width:0}
.review-import-card{display:grid;gap:10px;padding:12px}
.review-import-card>*,.review-import-row>*{min-width:0}
.review-card-heading,
.review-library-heading,
.review-import-preview-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.review-card-heading>div,.review-library-heading>div{min-width:0}
.review-card-heading h2,.review-card-heading h3,.review-library-heading h2{margin:0;color:var(--navy)}
.review-card-heading h2{font-size:.92rem}
.review-card-heading h3{font-size:.9rem;font-weight:650;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.review-card-heading p,.review-library-heading p{margin:3px 0 0;font-size:.72rem;line-height:1.35}
.review-import-card>textarea,
.review-import-row input,
.review-import-row select,
.review-import-row textarea,
.review-edit-form input:not([type="checkbox"]),
.review-edit-form select,
.review-edit-form textarea,
#reviewLibraryFilter{
  box-sizing:border-box;
  border:1px solid rgba(9,47,77,.16);
  border-radius:10px;
  background:#fffdf9;
  padding:8px 10px;
  font:inherit;
  font-size:.8rem;
  color:var(--ink);
}
.review-import-card>textarea,.review-import-row textarea,.review-edit-form textarea{width:100%;resize:vertical;line-height:1.4}
.review-import-card>textarea:focus,.review-import-row input:focus,.review-import-row select:focus,.review-import-row textarea:focus,.review-edit-form input:focus,.review-edit-form select:focus,.review-edit-form textarea:focus,#reviewLibraryFilter:focus{outline:none;border-color:rgba(9,47,77,.4);box-shadow:0 0 0 3px rgba(9,47,77,.08)}
.review-import-actions,.review-edit-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
.review-import-actions .muted{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.7rem}
.review-import-preview{border-top:1px solid rgba(9,47,77,.12);padding-top:12px}
.review-import-save{white-space:nowrap}
.review-import-row{padding:12px 0;border-top:1px solid rgba(9,47,77,.09)}
.review-import-row:first-child{padding-top:0;border-top:0}
.review-import-row-actions{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:nowrap}
.review-import-row-actions .review-remove-draft{margin-top:0}
.review-import-fields,.review-edit-grid{display:grid;grid-template-columns:2fr 2fr 1fr 1.4fr;gap:8px}
.review-import-fields>*,.review-edit-grid>*{min-width:0;width:100%;box-sizing:border-box}
.review-import-excerpt{display:grid;gap:5px;margin-top:10px;font-size:.7rem;font-weight:600;color:rgba(9,47,77,.68)}
.review-import-excerpt span{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.review-import-excerpt small{font-size:.66rem;font-weight:400;color:rgba(9,47,77,.56)}
.review-remove-draft{margin-top:8px}
.review-summary-grid{margin:0}
.review-summary{min-width:0}
.review-summary .dashboard-metric-value{font-variant-numeric:tabular-nums}
.review-library-heading{align-items:flex-end;margin-top:2px}
.review-library-heading .dashboard-section-title{font-size:.72rem}
#reviewLibraryFilter{min-height:32px;padding:4px 30px 4px 10px}
.review-admin-list{display:grid;gap:8px}
.review-admin-card{display:grid;gap:8px;padding:11px 12px;overflow:hidden}
.review-admin-card.is-hidden{opacity:.72}
.review-edit-toggle{flex:0 0 auto}
.review-admin-stars{color:#d89100;letter-spacing:.06em;margin:2px 0 0;font-size:.8rem;line-height:1}
.review-admin-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.45;margin:2px 0 0;font-size:.8rem;color:var(--ink)}
.review-admin-meta{margin:0;font-size:.68rem;line-height:1.3}
.review-placement-controls{display:flex;align-items:center;gap:14px;flex-wrap:nowrap;padding-top:8px;border-top:1px solid rgba(9,47,77,.1)}
.review-placement-controls label,.review-hidden-control{display:flex;align-items:center;gap:7px;font-size:.76rem;color:var(--ink)}
.review-placement-controls input[type="checkbox"],.review-hidden-control input[type="checkbox"]{width:16px;height:16px;margin:0;accent-color:var(--navy)}
.review-hidden-badge{font-size:.68rem;font-weight:600;padding:2px 8px;border-radius:999px;background:rgba(9,47,77,.09);color:var(--navy)}
.review-edit-form{display:grid;gap:10px;margin-top:2px;padding-top:10px;border-top:1px solid rgba(9,47,77,.12)}
.review-edit-form[hidden]{display:none}
.review-edit-form label{display:grid;gap:5px;font-size:.7rem;font-weight:600;color:rgba(9,47,77,.68)}
@media(max-width:700px){.review-import-fields,.review-edit-grid{grid-template-columns:1fr}.review-summary-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.review-card-heading{align-items:flex-start}.review-library-heading{align-items:center}.review-admin-text{font-size:.78rem}}
@media(max-width:420px){.review-library-heading{align-items:flex-end}}

/* =========================================================================
   BENCH TIMER MENU — MOBILE VISIBLE-VIEWPORT CONTAINMENT
   Keep the anchored timer sheet scrollable inside the live iPhone viewport.
   ========================================================================= */
.bench-choice-sheet.is-anchored .bench-choice-panel{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

/* =========================================================================
   MESSAGES V2 — DEER ISLAND CHAT FLOW
   One stable conversation surface: message history scrolls, chrome does not.
   Scoped to Messages so no other admin view inherits the layout behavior.
   ========================================================================= */
#messagesView.active{
  height:100vh;
  height:100dvh;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

#messagesView > .topbar{
  flex:0 0 auto;
}

#messagesPanel{
  flex:1 1 auto;
  min-width:0;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.messages-topbar-back{
  flex:0 0 auto;
  width:38px;
  min-width:38px;
  height:38px;
  min-height:38px;
  padding:0 0 2px;
  border-radius:10px;
  font-size:1.7rem;
  line-height:1;
}

.messages-thread-delete{
  color:#a3231c;
}

.msg-unread-badge{
  min-width:19px;
  height:19px;
  padding:0 5px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#0a84ff;
  color:#fff;
  font-size:.62rem;
  font-weight:700;
  line-height:1;
}

.msg-thread-chevron{
  color:rgba(9,47,77,.38);
  font-size:1.15rem;
  line-height:.8;
}

.msg-convo-shell{
  position:relative;
  gap:0;
  border:1px solid rgba(9,47,77,.10);
  border-radius:16px;
  overflow:hidden;
  background:#fffaf3;
  box-shadow:0 8px 22px rgba(9,47,77,.06);
}

.msg-convo-shell .msg-convo{
  padding:12px 10px 8px;
  background:rgba(255,253,248,.72);
  overscroll-behavior:contain;
}

.msg-convo-shell .msg-replybar{
  flex:0 0 auto;
  gap:7px;
  padding:8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top:1px solid rgba(9,47,77,.10);
  background:rgba(244,238,228,.96);
}

.msg-convo-shell .msg-replybar textarea{
  box-sizing:border-box;
  min-height:38px;
  height:38px;
  max-height:120px;
  padding:8px 13px;
  overflow-y:auto;
  line-height:1.35;
}

.msg-convo-shell .msg-send-btn,
.msg-convo-shell .msg-attach-btn{
  width:38px;
  height:38px;
}

.msg-send-btn:disabled{
  opacity:.36;
  cursor:default;
  transform:none;
}

.msg-line.is-pending{
  opacity:.62;
}

.msg-line.is-failed .msg-bubble{
  outline:1px solid rgba(163,35,28,.42);
}

.msg-line.is-failed .msg-time{
  color:#a3231c;
  opacity:1;
  font-weight:700;
}

.msg-jump-latest{
  position:absolute;
  left:50%;
  bottom:66px;
  z-index:2;
  transform:translateX(-50%);
  min-height:30px;
  padding:4px 11px;
  border:1px solid rgba(9,47,77,.16);
  border-radius:999px;
  background:var(--navy);
  color:#fffaf3;
  box-shadow:0 6px 18px rgba(9,47,77,.20);
  font-size:.7rem;
  font-weight:700;
}

.msg-jump-latest[hidden],
.messages-topbar-back[hidden],
.messages-thread-delete[hidden]{
  display:none;
}

.msg-convo-shell #msgReplyStatus{
  flex:0 0 auto;
  margin:0;
  padding:0 10px 7px;
  background:rgba(244,238,228,.96);
  font-size:.68rem;
}

.msg-convo-shell #msgReplyStatus:empty{
  display:none;
}

.msg-compose{
  width:min(520px,100%);
  margin:0;
  padding:14px;
  border:1px solid rgba(9,47,77,.10);
  border-radius:14px;
  background:#fffaf3;
}

@media (max-width:899px){
  #messagesPanel{
    padding:8px;
  }

  .msg-convo-shell{
    width:100%;
    border-radius:14px;
  }

  .msg-line{
    max-width:86%;
  }
}

/* =========================
   ADMIN BOOT SCREEN
   Shown only while html.admin-booting (saved token present) so the
   login view never flashes for signed-in users during init().
========================= */
.admin-boot-screen{
  display:none;
}

html.admin-booting .admin-boot-screen{
  position:fixed;
  inset:0;
  z-index:100000;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--bg, #f4eee4);
  opacity:1;
  transition:opacity .24s ease;
}

html.admin-booting.admin-boot-done .admin-boot-screen{
  opacity:0;
  pointer-events:none;
}

.admin-boot-screen .admin-boot-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  animation:adminBootIn .35s ease both;
}

.admin-boot-screen .admin-boot-logo{
  width:96px;
  height:96px;
  object-fit:contain;
  animation:adminBootPulse 1.6s ease-in-out infinite;
}

.admin-boot-screen .admin-boot-title{
  font-family:"Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight:600;
  font-size:.85rem;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--navy, #092f4d);
}

.admin-boot-screen .admin-boot-bar{
  position:relative;
  width:120px;
  height:3px;
  border-radius:999px;
  background:rgba(9,47,77,.12);
  overflow:hidden;
}

.admin-boot-screen .admin-boot-bar span{
  position:absolute;
  top:0;
  left:0;
  width:40%;
  height:100%;
  border-radius:999px;
  background:var(--navy, #092f4d);
  animation:adminBootSlide 1.1s ease-in-out infinite;
}

@keyframes adminBootIn{
  from{ opacity:0; transform:translateY(4px); }
  to{ opacity:1; transform:none; }
}

@keyframes adminBootPulse{
  0%, 100%{ transform:scale(1); }
  50%{ transform:scale(1.04); }
}

@keyframes adminBootSlide{
  0%{ transform:translateX(-100%); }
  100%{ transform:translateX(250%); }
}

@media (prefers-reduced-motion: reduce){
  .admin-boot-screen .admin-boot-inner,
  .admin-boot-screen .admin-boot-logo,
  .admin-boot-screen .admin-boot-bar span{
    animation:none;
  }
}

/* =========================
   Hide-from-gallery checkbox on gallery uploads
   (Gallery Uploader card + order "Add to Gallery" sheet). Scoped; the
   order sheet's full-width input rule must not stretch the checkbox.
   ========================= */
.gallery-hide-upload-row{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:0;
  font-size:.78rem;
  font-weight:600;
  line-height:1.35;
  cursor:pointer;
}
.gallery-hide-upload-row input[type="checkbox"],
.order-gallery-upload-fields .gallery-hide-upload-row input[type="checkbox"]{
  flex:0 0 auto;
  width:16px;
  min-width:16px;
  height:16px;
  min-height:16px;
  margin:1px 0 0;
  padding:0;
  accent-color:var(--navy);
}
.gallery-hide-upload-row .muted,
.gallery-upload-card .gallery-hide-upload-row .muted{
  font-size:inherit;
  font-weight:500;
}
.gallery-hide-upload-row,
.gallery-upload-card .gallery-hide-upload-row{
  color:var(--navy);
}
.gallery-hide-upload-row .muted,
.gallery-upload-card .gallery-hide-upload-row .muted{
  color:rgba(9,47,77,.64);
}
.order-gallery-upload-fields .gallery-hide-upload-row{
  margin-top:3px;
}
