/* ==========================================================================
   FENCING ORDER CONFIGURATOR — Master Stylesheet
   Mervyn Thomas Ltd

   TABLE OF CONTENTS

    1.  Global Resets ............. body, html, input defaults
    2.  Menu Bar .................. #menu, #title, nav icons, .pressed
    3.  Tab Content Area .......... #tabs-content, .tab-panel
    4.  Yard Mode Bar ............. #yard-bar, customer selector UI
    5.  Products Panel ............ #products, #inputandtagbar, #brandbar, tags
    6.  Tab Headers ............... .tab-header, icon-accessible hiding
    7.  Order Tab ................. .order-tab-container, items, delivery, billing
    8.  Product Cards & List ...... .products-grid, .products-list-row, pack chips
    9.  Modals & Overlays ......... .order-picker-overlay, template save
   10.  Profile Tab ............... .profile-tab-container, shared list styles
   11.  Product Detail Tab ........ .product-detail-container, gallery, specs
   12.  Home Tab .................. .home-tab-container
   13.  Mobile Responsive ......... @media max-width 600px
   14.  Tablet Responsive ......... @media 601–900px
   15.  Landscape Layout .......... @media landscape min-width 901px
   ========================================================================== */

/* ==========================================================================
   1. GLOBAL RESETS
   ========================================================================== */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    color: white;
    overflow: hidden
}

body {
    background: #091C48;
    display: flex;
    flex-direction: column;
    font-family: cardo, serif;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transition: opacity 0.2s ease;
}

body.app-loading {
    opacity: 0;
}
input {
  background: white; /*#091c48;*/
  /*color: #fff;*/
  touch-action: manipulation;
  -webkit-appearance: none;
  border-radius: 4px;
}

/* ==========================================================================
   2. MENU BAR & NAVIGATION
   ========================================================================== */

#menu {
    display: grid;
    grid-template: auto auto / fit-content(100%) auto 10px fit-content(100%) fit-content(100%) fit-content(100%) fit-content(100%) fit-content(100%) fit-content(100%) fit-content(100%);
    color: white;
    border-bottom: 1px solid gold;
    font-weight: bold;
    grid-gap:5px;
    height: 56px;
    touch-action: manipulation;
}
#tabs-header {
  grid-area: 1 / 2 / 3 / 3; 
  justify-self: end;
  align-self: center;
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  height: 100%;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#tabs-header::-webkit-scrollbar {
  display: none;
}
#title {
  grid-area: 1 / 1 / 3 / 2;
  align-self: center;
  padding: 1em;
  border-right: 1px solid gold;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pressed {
  box-shadow: 
    0 1px 2px gold, 
    inset 0 3px 6px gold !important;
}
#new_order_button {
  justify-self: end;
  align-self: center;
  text-align:center;
  cursor: pointer;
  grid-area: 1 / 4 / 3 / 5; 
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#profile_icon {
  justify-self: end;
  align-self: center;
  text-align:center;
  cursor: pointer;
  grid-area: 1 / 10 / 3 / 11; 
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#orders_icon,
#templates_icon,
#stock_icon,
#loads_icon,
#dashboard_icon,
#profile_icon {
  border-radius: 6px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#orders_icon.icon-active,
#templates_icon.icon-active,
#stock_icon.icon-active,
#loads_icon.icon-active,
#dashboard_icon.icon-active,
#profile_icon.icon-active {
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}
#orders_icon {
  justify-self: end;
  align-self: center;
  text-align: center;
  cursor: pointer;
  grid-area: 1 / 5 / 3 / 6;
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#templates_icon {
  justify-self: end;
  align-self: center;
  text-align: center;
  cursor: pointer;
  grid-area: 1 / 6 / 3 / 7;
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#stock_icon {
  justify-self: end;
  align-self: center;
  text-align: center;
  cursor: pointer;
  grid-area: 1 / 7 / 3 / 8;
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#loads_icon {
  justify-self: end;
  align-self: center;
  text-align: center;
  cursor: pointer;
  grid-area: 1 / 8 / 3 / 9;
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#dashboard_icon {
  justify-self: end;
  align-self: center;
  text-align: center;
  cursor: pointer;
  grid-area: 1 / 9 / 3 / 10;
  height: 20px;
  width: 50px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.permanenttag.hidden {
    display: flex !important; /* Ensure permanent tags stay visible */
}
.off_screen { 
  display: none;
}
/* ==========================================================================
   3. TAB CONTENT AREA
   ========================================================================== */

#tabs-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1em;
    background: #091C48;
    display: grid;
    grid-template: auto auto auto / minmax(0, 1fr);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}
.tab-panel {
    width: 100%;
    min-width: 0;
}

/* ==========================================================================
   4. YARD MODE BAR
   ========================================================================== */

#yard-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 1em;
  background: #1a5276;
  color: white;
  border-bottom: 2px solid gold;
  font-size: 0.9em;
}

.yard-label {
  font-weight: bold;
}

.yard-customer-name {
  color: gold;
  font-weight: bold;
}

.yard-customer-id {
  color: #aaa;
  font-size: 0.85em;
}

.yard-btn {
  padding: 4px 12px;
  background: none;
  border: 1px solid gold;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
}

.yard-btn:hover {
  background: rgba(255, 215, 0, 0.15);
}

.yard-btn-clear {
  border-color: #ff6666;
  color: #ff6666;
}

.yard-btn-clear:hover {
  background: rgba(255, 100, 100, 0.2);
}

.yard-customer-search {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
  box-sizing: border-box;
}

.yard-customer-search:focus {
  border-color: gold;
  outline: none;
}

/* ==========================================================================
   5. PRODUCTS PANEL (search, tags, brand bar)
   ========================================================================== */

#products {
  display: flex;
  flex-direction: column;
  max-height: 35vh;
  overflow-y: auto;
  border-top: 1px solid gold;
  background: #091C48;
  padding: 5px 1em;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  transition: max-height 0.3s ease, padding 0.3s ease, border-top-width 0.3s ease;
}

#products.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  overflow: hidden;
}

#inputandtagbar {
  display: grid;
  grid-template: auto / 25% 1fr;
  background: #091C48;
  border-top: 1px solid #ccc;
  gap: 0.1em;
  align-items: center;
  max-height: 200px;
  transition: max-height 0.3s ease, padding 0.3s ease, border-top-width 0.3s ease;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
}

#inputandtagbar.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  overflow: hidden;
}

#brandbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #091C48;
  padding: 6px 1em;
  border-top: 1px solid gold;
  white-space: nowrap;
  transition: max-height 0.3s ease, padding 0.3s ease, border-top-width 0.3s ease;
  max-height: 200px;
}

#brandbar.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
  overflow: hidden;
}

#brand-tags-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#brand-tags-container::-webkit-scrollbar {
  display: none;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 0.6em 1.2em;
  border: 2px solid gold;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  box-sizing: border-box;
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: bold;
  font-size: 0.95em;
  transition: background 0.2s ease, color 0.2s ease;
}

.brand-tag:hover {
  background: rgba(255, 215, 0, 0.15);
}

.brand-tag.active {
  background: gold;
  color: #091C48;
}

#products-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font-size: 1.2em;
  color: gold;
  transition: transform 0.3s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#products-toggle.collapsed {
  transform: rotate(180deg);
}

#view-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font-size: 1.2em;
  color: gold;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  border: 1px solid gold;
  border-radius: 4px;
}

#view-mode-toggle:hover {
  background: rgba(255, 215, 0, 0.15);
}

#input {
  display: flex;
  align-items: center;
  padding: 5px;
  touch-action: manipulation;
  position: relative;
}

#inputtext {
  width: 100%;
  padding: 0.5em 2em 0.5em 0.5em;
  box-sizing: border-box;
}

.input-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #999;
  font-size: 1.3em;
  line-height: 1;
  border-radius: 50%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.input-clear-btn:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.08);
}

#tagbar {
  display: flex;
  background: #091C48;
  padding: 5px;
  gap: 5px;
  overflow-x: auto;
  white-space: nowrap;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  align-items: center;
}

@keyframes tag-emphasise {
  0%   { transform: scale(1);    box-shadow: 0 1px 2px gold, inset 0 3px 6px gold; }
  40%  { transform: scale(1.1);  box-shadow: 0 0 10px 2px gold, inset 0 3px 6px gold; }
  100% { transform: scale(1);    box-shadow: 0 1px 2px gold, inset 0 3px 6px gold; }
}

.tag-emphasise {
  animation: tag-emphasise 0.4s ease-out;
}

.tag-attr-prefix {
    color: #888;
    font-size: 0.8em;
    font-weight: normal;
    margin-right: 1px;
}

.pressed .tag-attr-prefix {
    color: rgba(255, 215, 0, 0.6);
}

.tag-clear-all {
    border-color: #ff6666;
    color: #ff6666;
    order: -2;
    flex-shrink: 0;
    font-size: 1.1em;
    line-height: 1;
}

.tag-clear-all:hover {
    background: rgba(255, 100, 100, 0.3);
    color: white;
}

.permanenttag {
    border: 2px solid red !important;
    /*position: sticky;*/
    left: 0;
    z-index: 10;
    order: -1;
}
.permanenttag {
    display: grid !important;
}
.removebutton {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
} 
.removebutton:hover {
  color: #555;
}

.tag .removebutton {
    display: none;
    text-wrap: nowrap;
}
.permanenttag .removebutton {
    display: inline-block;
}
.tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: white;
    padding: 0.75em;
    border: 1px solid gold;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    min-width: 44px;
    box-sizing: border-box;
    flex-shrink: 0;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   6. TAB HEADERS
   ========================================================================== */

/* Tab header styling */
.tab-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid gold;
  cursor: pointer;
  padding: 5px 10px;
  background-color: #091C48;
  color: white;
  min-width: 100px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.tab-header.active {
  background-color: #000;
  border-bottom: 2px solid gold;
}

/* Icon-accessible tabs don't need a tab header — always reachable via menu icons */
.tab-header[data-tab-id="home"],
.tab-header[data-tab-id="user_profile"],
.tab-header[data-tab-id="orders_list"],
.tab-header[data-tab-id="templates_list"],
.tab-header[data-tab-id="stock_take"],
.tab-header[data-tab-id="scheduled_loads_list"],
.tab-header[data-tab-id="dashboard_view"] {
  display: none;
}

.tab-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.tab-close {
  cursor: pointer;
  min-width: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-close:hover {
  color: #ff6666;
}

/* ==========================================================================
   7. ORDER TAB (items, delivery, billing, discounts, totals)
   ========================================================================== */

.order-tab-container {
  position: relative;
  background: white;
  color: #222;
  border-radius: 6px;
  padding: 20px;
  max-width: 900px;
}

.order-tab-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  font-size: 1.1em;
  border-radius: 50%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  z-index: 1;
}

.order-tab-close:hover {
  color: #cc0000;
  background: #fee;
}

.order-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid gold;
  flex-wrap: wrap;
}

.order-title-bar .order-name {
  font-size: 1.4em;
  font-weight: bold;
  outline: none;
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 100px;
}

.order-title-bar .order-name:focus {
  background: #f0f0f0;
  box-shadow: 0 0 0 2px gold;
}

.order-title-bar .edit-icon {
  color: #999;
  font-size: 0.9em;
}

.order-dates {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.order-created-date {
  font-size: 0.78em;
  color: #aaa;
  white-space: nowrap;
}

.order-updated-date {
  font-size: 0.78em;
  color: #aaa;
  white-space: nowrap;
}

.order-updated-date:empty {
  display: none;
}

.order-reference-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-height: 20px;
  padding-left: 6px;
}

.order-reference-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.order-reference-text {
  font-size: 0.85em;
  color: #777;
  font-style: italic;
}

.order-reference-add,
.order-reference-toggle {
  font-size: 0.8em;
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.order-reference-toggle {
  font-size: 0.9em;
}

.order-reference-add:hover,
.order-reference-toggle:hover {
  color: #091C48;
}

.order-reference-edit-row {
  align-items: center;
  gap: 8px;
  flex: 1;
}

.order-reference-input {
  flex: 1;
  max-width: 400px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
}

.order-reference-input:focus {
  border-color: gold;
  outline: none;
}

.order-confirmed-badge {
  background: #2a7d2a;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-invoiced-badge {
  background: #1a5276;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-unconfirmed-badge {
  background: #c47f17;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-quoted-badge {
  background: #6c3483;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-details {
  margin-bottom: 16px;
}

.order-empty {
  color: #888;
  font-style: italic;
  padding: 20px 0;
}

.order-header-row,
.order-item-row,
.order-total-row {
  display: grid;
  grid-template-columns: 36px 1fr 170px 90px 90px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.order-header-row {
  font-weight: bold;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.order-item-row {
  border-bottom: 1px dashed #e0e0e0;
}

.order-item-row:hover {
  background: #f8f8f0;
}

.order-delivery-row {
  border-top: 1px solid #ddd;
  font-style: italic;
  color: #555;
}

.delivery-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-style: normal;
  padding: 2px 0;
}

.delivery-toggle-label {
  color: #bbb;
  font-weight: normal;
  transition: color 0.2s ease;
  white-space: nowrap;
  display: inline-block;
}

.delivery-toggle-label.active {
  color: #222;
}

.delivery-mode-toggle {
  flex-shrink: 0;
}

.order-delivery-row .order-col-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-delivery-row .delivery-note {
  margin-top: 0;
}

.order-col-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-expand-btn {
  display: none;
}

.order-col-price,
.order-col-total {
  text-align: right;
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  background: #f5f5f5;
  font-size: 1em;
  line-height: 1;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
}

.qty-btn:hover {
  background: #e8e8e0;
  border-color: gold;
}

.qty-value {
  min-width: 48px;
  text-align: center;
  font-weight: bold;
}

.qty-input {
  width: 62px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  text-align: center;
  background: #fff;
  color: #222;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:focus {
  border-color: gold;
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  color: #999;
  font-size: 0.9em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
}

.remove-btn:hover {
  color: #cc0000;
  background: #fee;
}

.order-total-row {
  border-top: 2px solid #333;
  margin-top: 4px;
  padding-top: 10px;
  font-weight: bold;
  font-size: 1.1em;
}

.order-total-label {
  text-align: right;
}

.order-total-value {
  text-align: right;
}

.order-delivery-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease;
}

.order-delivery-section.expanded {
  max-height: 800px;
  padding: 12px;
  margin: 16px 0;
}

.delivery-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  color: #999;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.2s ease;
  background: #f5f5f5;
}

.delivery-option.selected {
  color: #222;
  border-color: #091C48;
  background: white;
  font-weight: bold;
  box-shadow: 0 0 0 2px rgba(9, 28, 72, 0.2);
}

.delivery-option:hover {
  border-color: #091C48;
}

.delivery-option input[type="radio"] {
  accent-color: #091C48;
}

.delivery-postcode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.delivery-cost-display {
  font-size: 0.9em;
  color: #666;
  font-style: italic;
}

.delivery-cost-display:empty {
  display: none;
}

.delivery-threshold-info {
  font-size: 0.8em;
  color: #999;
}

.delivery-threshold-info:empty {
  display: none;
}

.delivery-details-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.delivery-details-summary {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}

.delivery-details-expanded {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin-top 0.35s ease;
}

.delivery-details-expanded.expanded {
  max-height: 800px;
  margin-top: 10px;
}

.delivery-details-expanded h4 {
  margin: 0 0 6px 0;
  color: #091C48;
  font-size: 0.9em;
}

.delivery-note {
  display: block;
  margin-top: 8px;
  font-size: 0.8em;
  color: #888;
  font-style: italic;
  line-height: 1.4;
}

.order-delivery-notes-section {
  margin-top: 0;
}

.delivery-notes-input {
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
  min-height: 60px;
}

.delivery-notes-input:focus {
  border-color: gold;
  outline: none;
}

.delivery-notes-input[readonly] {
  background: #f0f0f0;
  color: #666;
}

.order-address-section {
  margin-top: 12px;
  padding: 12px;
}

.order-address-section h4 {
  margin: 0 0 8px 0;
  color: #091C48;
  font-size: 0.95em;
}

.order-address-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 400px;
}

.order-address-fields input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
}

.order-address-fields input:focus {
  border-color: gold;
  outline: none;
}

.order-address-fields input[readonly] {
  background: #f0f0f0;
  color: #666;
}

.order-link-btn {
  background: none;
  border: 1px solid #091C48;
  color: #091C48;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8em;
  margin-bottom: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.order-link-btn:hover {
  background: #091C48;
  color: white;
}

.order-billing-section {
  margin: 12px 0;
  padding: 12px;
}

.order-billing-section h4 {
  margin: 0;
  color: #091C48;
  font-size: 0.95em;
}

.billing-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.delivery-header-row h4 {
  margin: 0;
  color: #091C48;
  font-size: 0.95em;
}

.delivery-header-row .delivery-details-toggle {
  margin-top: 0;
}

.billing-details-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-details-summary {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}

.billing-details-expanded {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-billing-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.order-quotation-notes {
  margin: 12px 0;
  padding: 12px;
}

.order-quotation-notes h4 {
  margin: 0 0 8px 0;
  color: #091C48;
  font-size: 0.95em;
}

.quotation-notes-input {
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
  min-height: 60px;
}

.quotation-notes-input:focus {
  border-color: gold;
  outline: none;
}

.order-grand-total {
  margin: 16px 0;
  padding: 12px;
}

.order-total-line {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 4px 0;
}

.order-total-line .order-total-label {
  font-weight: bold;
  color: #555;
  min-width: 140px;
  text-align: right;
}

.order-total-line .order-total-value {
  font-weight: bold;
  min-width: 90px;
  text-align: right;
}

/* Discount block — right-aligned container that keeps all three rows
   horizontally aligned with each other while sitting on the right. */
.order-discounts-block {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  width: fit-content;
  min-width: 280px;
  max-width: 100%;
}

/* Discount rows — stacked labels (prefix above description) aligned left,
   values right-aligned within the block. */
.order-discount-line {
  justify-content: space-between;
}

.order-discount-line .order-total-label {
  text-align: left;
  min-width: 0;
  flex: 1;
}

.discount-label-stacked {
  display: flex;
  flex-direction: column;
}

/* Discount A value — toggle switch sits alongside the amount */
.order-discount-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.discount-amount {
  min-width: 90px;
  text-align: right;
  display: inline-block;
}

/* Toggle switch (used in Discount A row) */
.discount-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.discount-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  position: absolute;
}

.discount-toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 20px;
  transition: background-color 0.2s ease;
}

.discount-toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.discount-toggle input:checked + .discount-toggle-slider {
  background-color: #091C48;
}

.discount-toggle input:checked + .discount-toggle-slider::before {
  transform: translateX(16px);
}

.discount-toggle input:focus-visible + .discount-toggle-slider {
  box-shadow: 0 0 0 2px gold;
}

.discount-toggle input:disabled + .discount-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.discount-label-prefix {
  font-weight: bold;
  color: #333;
  font-size: 0.95em;
}

.discount-label-desc {
  font-weight: normal;
  color: #999;
  font-size: 0.82em;
}

.order-total-grand {
  font-size: 1.2em;
  border-top: 2px solid #333;
  margin-top: 4px;
  padding-top: 8px;
  color: #091C48;
}

.order-subtotal-row {
  border-top: 1px solid #ddd;
  font-size: 0.9em;
  color: #666;
}

/* Attribute-derived totals (e.g. netting/wire lengths) — subtle summary line */
.order-attribute-totals {
  font-size: 0.8em;
  color: #999;
  font-style: italic;
  padding: 4px 12px;
}

.order-attribute-totals:empty {
  display: none;
}

.attribute-total-item {
  white-space: nowrap;
}

.attribute-total-sep {
  color: #ccc;
  padding: 0 4px;
}

.order-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.order-action-btn {
  padding: 10px 20px;
  background: #091C48;
  color: white;
  border: 1px solid gold;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.order-action-btn:hover {
  background: #0d2660;
}

/* ==========================================================================
   8. PRODUCT CARDS & LIST VIEW
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

/* List view layout */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.products-list-header {
  display: grid;
  grid-template-columns: 1fr 70px 70px var(--pack-size-col-width, 100px) 84px;
  gap: 8px;
  padding: 6px 10px;
  font-weight: bold;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: gold;
  border-bottom: 1px solid gold;
  align-items: center;
}

.products-list-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px var(--pack-size-col-width, 100px) 84px;
  gap: 8px;
  padding: 6px 10px;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 215, 0, 0.2);
  cursor: pointer;
  font-size: 0.9em;
}

.products-list-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.list-col-decanted,
.list-col-pack {
  text-align: right;
}

.list-action-price {
  display: none;
}

.list-action-item {
  display: contents;
}

.list-col-size {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  align-items: center;
}

.list-col-size .pack-size-select {
  min-height: 28px;
  font-size: 0.85em;
  padding: 2px 4px;
}

.pack-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-size: 0.8em;
  cursor: pointer;
  min-height: 26px;
  min-width: 28px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pack-chip:hover {
  border-color: gold;
}

.pack-chip.active {
  background: gold;
  color: #091C48;
  border-color: gold;
  font-weight: bold;
}

.list-col-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.list-col-actions button {
  padding: 4px 10px;
  background-color: #091C48;
  color: white;
  border: 1px solid gold;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 36px;
  font-size: 0.8em;
  border-radius: 3px;
  white-space: nowrap;
}

.list-col-actions button:hover {
  background-color: #003366;
}

.product-card {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 15px;
  border: 1px solid gold;
  border-radius: 5px;
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-name {
  font-weight: bold;
  font-size: 1.1em;
}

.product-prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  flex-wrap: wrap;
}

.price-row .price-label {
  font-weight: bold;
  color: #999;
  min-width: 70px;
}

.product-card .price-row .price-label {
  color: #ccc;
}

.price-row .price-value {
  font-weight: bold;
  color: #091C48;
  min-width: 60px;
}

.product-card .price-row .price-value {
  color: gold;
}

.pack-sizes-label {
  color: #888;
  font-size: 0.85em;
  margin-left: 4px;
}

.product-card .pack-sizes-label {
  color: #aaa;
}

.pack-size-select {
  padding: 4px 8px;
  background-color: #091C48;
  color: white;
  border: 1px solid gold;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  min-height: 32px;
  touch-action: manipulation;
  -webkit-appearance: none;
}

.pack-size-select:focus {
  outline: none;
  border-color: white;
}

.pack-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-col-size .pack-chip {
  min-height: 26px;
}

.price {
  font-size: 0.9em;
}

.product-add-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 215, 0, 0.25);
}


/* ==========================================================================
   9. MODALS & OVERLAYS
   ========================================================================== */

.order-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.order-picker-modal {
  background: white;
  color: #222;
  padding: 20px;
  border-radius: 8px;
  min-width: 280px;
  max-width: 400px;
  width: 100%;
}

.order-picker-modal h3 {
  margin: 0 0 12px 0;
  color: #091C48;
}

.order-picker-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.order-picker-option {
  padding: 10px 14px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
  text-align: left;
  touch-action: manipulation;
}

.order-picker-option:hover {
  border-color: #091C48;
  background: #eef;
}

.order-picker-new {
  color: #091C48;
  font-weight: bold;
  border-style: dashed;
}

.remove-confirm-text {
  margin: 0 0 12px;
  color: #555;
  font-size: 0.9em;
  line-height: 1.4;
}

.order-picker-cancel {
  padding: 8px 16px;
  background: none;
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  color: #666;
}

.order-picker-cancel:hover {
  background: #f0f0f0;
}

.template-save-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.template-save-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-save-field label {
  font-size: 0.85em;
  color: #555;
  font-weight: bold;
}

.template-save-field input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95em;
}

.template-save-field input:focus {
  border-color: gold;
  outline: none;
}

.card-add-btn {
  padding: 4px 12px;
  background-color: #091C48;
  color: white;
  border: 1px solid gold;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 32px;
}

.card-add-btn:hover {
  background-color: #003366;
}

.card-pack-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Card-mode chips on dark card background */
.product-card .pack-chip {
  border-color: rgba(255, 215, 0, 0.4);
  color: white;
}

.product-card .pack-chip:hover {
  border-color: gold;
}

.product-card .pack-chip.active {
  background: gold;
  color: #091C48;
  border-color: gold;
  font-weight: bold;
}

/* ==========================================================================
   10. PROFILE TAB & SHARED LIST STYLES
   ========================================================================== */

.profile-tab-container {
  background-color: #091C48;
  color: white;
  padding: 20px;
}

.profile-header {
  border-bottom: 1px solid gold;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.profile-header h2 {
  margin: 0;
}

.profile-name-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.profile-account-id {
  font-size: 0.85em;
  color: #aaa;
  margin-top: 4px;
}

.profile-header-actions {
  margin-bottom: 12px;
}

.profile-edit-name-btn {
  font-size: 0.8em;
  padding: 6px 14px;
  opacity: 0.7;
}

.profile-edit-name-btn:hover {
  opacity: 1;
}

.profile-name-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-name-edit input {
  padding: 8px;
  font-size: 1.1em;
  font-family: inherit;
  background-color: white;
  color: #091C48;
  border: 1px solid gold;
  border-radius: 3px;
  max-width: 300px;
  box-sizing: border-box;
}

.profile-section {
  margin-bottom: 20px;
}

.profile-section h3 {
  color: gold;
  margin-bottom: 10px;
}

.profile-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 30px;
  margin-bottom: 20px;
}

.profile-dashboard-left,
.profile-dashboard-right {
  min-width: 0;
}

.profile-field {
  margin-bottom: 10px;
}

.profile-field label {
  display: block;
  margin-bottom: 5px;
}

.profile-field input {
  width: 100%;
  max-width: 400px;
  padding: 8px;
  background-color: white;
  color: #091C48;
  border: 1px solid gold;
  border-radius: 3px;
  touch-action: manipulation;
  box-sizing: border-box;
}

.profile-value {
  display: block;
  padding: 8px 0;
  color: white;
  font-size: 1em;
}

/* Account level — read-only badge + discount summary */
.account-level-display {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.account-level-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(255, 215, 0, 0.12);
  color: gold;
  border: 1px solid gold;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.95em;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.account-level-discount {
  color: #ccc;
  font-size: 0.9em;
  font-style: italic;
}

/* Email addresses display/edit */
.email-display {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.email-line {
  padding: 6px 0;
  background: transparent;
  color: white;
  border: none;
  min-width: 0;
  max-width: 400px;
  word-break: break-all;
  box-sizing: border-box;
  font-size: 1em;
}

.email-edit-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.email-edit-form input {
  box-sizing: border-box;
}

.email-edit-form .order-action-btn {
  margin-top: 8px;
  align-self: flex-start;
}

.email-error {
  display: none;
  color: #ff6666;
  font-size: 0.85em;
  margin-top: 4px;
}

.order-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


.profile-subscript {
  font-size: 0.85em;
  color: #aaa;
  font-style: italic;
  margin: 0 0 10px 0;
}

.profile-address-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-address-form .order-action-btn {
  margin-top: 8px;
  align-self: flex-start;
}

.address-display {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.address-letter-box {
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  padding: 16px 24px;
  border: none;
  border-left: 3px solid gold;
  border-radius: 0;
  min-width: 0;
  max-width: 350px;
  line-height: 1.6;
  font-family: inherit;
  box-sizing: border-box;
  word-break: break-word;
}

.address-line {
  white-space: pre-wrap;
}

.orders-list, .templates-list {
  list-style: none;
  padding: 0;
}

.order-item, .template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  margin-bottom: 5px;
  border: 1px solid gold;
  touch-action: manipulation;
  cursor: pointer;
  max-width: 600px;
}

.order-item:hover, .template-item:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

/* Pulse for profile order-list items (dark background → subtle white) */
@keyframes order-item-pulse {
  0%   { background-color: rgba(255, 215, 0, 0.4); }
  100% { background-color: rgba(255, 255, 255, 0.1); }
}

.order-item-pulse {
  animation: order-item-pulse 1.5s ease-out;
}

/* Pulse for order-tab item rows (white background → transparent) */
@keyframes order-row-pulse {
  0%   { background-color: rgba(255, 215, 0, 0.5); }
  100% { background-color: transparent; }
}

.order-item-row.order-row-pulse {
  animation: order-row-pulse 1.5s ease-out;
}

.order-item button, .template-item button {
  padding: 5px 10px;
  background-color: #091C48;
  color: white;
  border: 1px solid gold;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  min-width: 44px;
}

.order-item button:hover, .template-item button:hover {
  background-color: #003366;
}

.delete-btn {
  background-color: #8b0000 !important;
  border-color: #cc0000 !important;
}

.delete-btn:hover {
  background-color: #cc0000 !important;
}

.order-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.order-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-item-meta {
  font-size: 0.85em;
  color: #aaa;
}

.profile-show-more-btn {
  display: block;
  width: 100%;
  max-width: 600px;
  padding: 8px 16px;
  margin-top: 4px;
  background: none;
  border: 1px dashed gold;
  border-radius: 4px;
  color: gold;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.profile-show-more-btn:hover {
  background: rgba(255, 215, 0, 0.1);
}

.profile-actions {
  margin-top: 20px;
  display: flex;
  gap: 15px;
}

.profile-actions button {
  padding: 10px 20px;
  background-color: #091C48;
  color: white;
  border: 1px solid gold;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.profile-actions button:hover {
  background-color: #003366;
}

#sign-out-btn {
  background-color: #8b0000;
  border-color: #cc0000;
}

#sign-out-btn:hover {
  background-color: #cc0000;
}

/* ==========================================================================
   11. PRODUCT DETAIL TAB
   ========================================================================== */

.product-detail-container {
  background: white;
  color: #222;
  border-radius: 6px;
  padding: 20px;
  max-width: 960px;
}

.product-detail-header {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid gold;
}

.product-detail-header h2 {
  margin: 0;
  color: #091C48;
  padding-right: 36px;
}

.product-detail-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  font-size: 1.3em;
  border-radius: 50%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.product-detail-close:hover {
  color: #cc0000;
  background: #fee;
}

.product-detail-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  min-width: 0;
  overflow: hidden;
  padding-top: 16px;
}

@media (max-width: 700px) {
  .product-detail-body {
    grid-template-columns: 1fr;
  }
}

/* Gallery placeholders */
.product-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-detail-image-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #d0d0d0 0%, #e8e8e8 50%, #d0d0d0 100%);
  border: 1px dashed #aaa;
  border-radius: 4px;
}

.product-detail-image-thumbs {
  display: flex;
  gap: 8px;
}

.product-detail-thumb {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #c8c8c8 0%, #e0e0e0 50%, #c8c8c8 100%);
  border: 1px dashed #aaa;
  border-radius: 3px;
}

/* Info sections */
.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.product-detail-section h3 {
  margin: 0 0 8px 0;
  color: #091C48;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-detail-description-placeholder {
  background: #f5f5f0;
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 12px;
  min-height: 60px;
}

.product-detail-description-placeholder p {
  margin: 0;
  color: #444;
  line-height: 1.5;
}

.product-detail-specs-placeholder {
  background: #f5f5f0;
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 12px;
  overflow: hidden;
}

.spec-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.spec-row::-webkit-scrollbar {
  display: none;
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: bold;
  min-width: 100px;
  color: #555;
  flex-shrink: 0;
}

.spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.spec-tags .tag {
  padding: 0.4em 0.6em;
  font-size: 0.85em;
  min-height: 32px;
  min-width: unset;
  background-color: #091C48;
}

.product-detail-pricing {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f5f0;
  border-radius: 4px;
}

.price-label {
  font-weight: bold;
  color: #555;
}

.price-value {
  font-size: 1.2em;
  font-weight: bold;
  color: #091C48;
}

.product-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

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

.detail-pack-sizes {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-pack-sizes .pack-chip {
  border-color: rgba(9, 28, 72, 0.4);
  color: #091C48;
}

.detail-pack-sizes .pack-chip:hover {
  border-color: #091C48;
}

.detail-pack-sizes .pack-chip.active {
  background: #091C48;
  color: white;
  border-color: #091C48;
}

/* Product detail — populated image styles */
.product-detail-image-main.has-image {
  background: #f5f5f0;
  border: 1px solid #ddd;
}

.product-detail-image-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.product-detail-thumb.has-image {
  background: #f5f5f0;
  border: 1px solid #ddd;
  cursor: pointer;
}

.product-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.product-detail-thumb.active {
  border: 2px solid gold;
}

/* Product detail — links and resources */
.product-detail-links-placeholder {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-detail-links-placeholder h4 {
  margin: 8px 0 4px;
  color: #091C48;
  font-size: 0.9em;
}

.product-detail-links-placeholder h4:first-child {
  margin-top: 0;
}

.product-detail-link,
.product-detail-resource-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f0;
  border-radius: 4px;
  color: #091C48;
  text-decoration: none;
  font-size: 0.9em;
}

.product-detail-link:hover,
.product-detail-resource-link:hover {
  background: #e8e8e0;
}

/* Stock Take section — within product detail tab (yard/admin only) */
.stock-take-section {
  margin-top: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid gold;
}

/* Stock image management */
.stock-images-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd;
}

.stock-images-section h4 {
  margin: 0 0 8px 0;
  color: #091C48;
  font-size: 0.9em;
}

.stock-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.stock-image-item {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.stock-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stock-image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(200, 0, 0, 0.8);
  color: white;
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.stock-image-remove:hover {
  background: #c00;
}

.stock-image-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stock info editing (description, links, resources) */
.stock-info-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd;
}

.stock-info-section h4 {
  margin: 0 0 8px 0;
  color: #091C48;
  font-size: 0.9em;
}

.stock-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stock-info-header h4 {
  margin: 0;
}

.stock-edit-pencil {
  cursor: pointer;
  font-size: 0.9em;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.stock-edit-pencil:hover {
  opacity: 1;
}

.stock-desc-view {
  color: #444;
  line-height: 1.5;
  font-size: 0.9em;
  white-space: pre-wrap;
  margin: 0;
}

.stock-desc-input {
  width: 100%;
  max-width: 500px;
  min-height: 100px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
  box-sizing: border-box;
}

.stock-desc-input:focus {
  border-color: gold;
  outline: none;
}

.stock-links-list,
.stock-resources-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.stock-link-item,
.stock-resource-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f5f5f0;
  border-radius: 3px;
  font-size: 0.9em;
}

.stock-link-item-text,
.stock-resource-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-add-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.stock-link-label-input,
.stock-link-url-input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
}

.stock-link-label-input {
  width: 120px;
}

.stock-link-url-input {
  width: 200px;
  flex: 1;
  min-width: 150px;
}

.stock-link-label-input:focus,
.stock-link-url-input:focus {
  border-color: gold;
  outline: none;
}

.stock-resource-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-info-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #ddd;
}

.stock-take-section h3 {
  margin: 0 0 12px 0;
  color: #091C48;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stock-pack-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.stock-pack-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-pack-label,
.stock-loose-label {
  min-width: 120px;
  font-weight: bold;
  color: #555;
}

.stock-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #091C48;
  border-radius: 6px;
  cursor: pointer;
  background: #f5f5f5;
  font-size: 1.4em;
  font-weight: bold;
  line-height: 1;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: #091C48;
  flex-shrink: 0;
}

.stock-qty-btn:hover {
  background: #e8e8e0;
  border-color: gold;
}

.stock-qty-btn:active {
  background: #ddd;
  transform: scale(0.95);
}

.stock-qty-btn-med {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  font-size: 1em;
}

.stock-qty-btn-lg {
  width: auto;
  min-width: 52px;
  padding: 0 8px;
  font-size: 1em;
}

.stock-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: transparent;
  color: #999;
  font-size: 1.1em;
  cursor: pointer;
  margin-left: 6px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.stock-remove-btn:hover {
  background: #fee;
  border-color: #c00;
  color: #c00;
}

.stock-pack-input,
.stock-loose-input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  -moz-appearance: textfield;
}

.stock-pack-input::-webkit-outer-spin-button,
.stock-pack-input::-webkit-inner-spin-button,
.stock-loose-input::-webkit-outer-spin-button,
.stock-loose-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-pack-input:focus,
.stock-loose-input:focus {
  border-color: gold;
  outline: none;
}

.stock-pack-suffix {
  color: #888;
  font-size: 0.85em;
}

.stock-add-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stock-new-size-input {
  width: 120px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95em;
}

.stock-new-size-input:focus {
  border-color: gold;
  outline: none;
}

.stock-add-size-btn {
  font-size: 0.85em;
  padding: 6px 12px;
}

.stock-loose-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.stock-meta {
  font-size: 0.8em;
  color: #999;
  font-style: italic;
  margin-bottom: 12px;
}

.stock-empty {
  color: #888;
  font-style: italic;
  font-size: 0.9em;
  margin: 0;
}

.stock-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid gold;
}

/* Stock Take Tab — scanning landing page (yard/admin only) */
.stock-take-tab-container {
  background-color: #091C48;
  color: white;
  padding: 20px;
  max-width: 600px;
}

.stock-take-tab-container h2 {
  color: gold;
  margin: 0 0 12px 0;
}

.stock-take-instructions {
  color: #ccc;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.stock-take-instructions code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.stock-take-scan-row {
  margin-bottom: 20px;
}

.stock-take-scan-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid gold;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1.1em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-sizing: border-box;
}

.stock-take-scan-input::placeholder {
  color: #888;
}

.stock-take-scan-input:focus {
  outline: none;
  border-color: white;
  background: rgba(255, 255, 255, 0.12);
}

.stock-take-scan-log h3 {
  color: gold;
  margin: 0 0 10px 0;
  font-size: 1em;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 6px;
}

.stock-take-log-empty {
  color: #888;
  font-style: italic;
  font-size: 0.9em;
}

.stock-take-log-entry {
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 0.9em;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.stock-take-log-success {
  background: rgba(42, 125, 42, 0.25);
  border-left: 3px solid #2a7d2a;
}

.stock-take-log-error {
  background: rgba(200, 0, 0, 0.2);
  border-left: 3px solid #c00;
}

.stock-take-log-time {
  color: #aaa;
  font-size: 0.85em;
  flex-shrink: 0;
}

.stock-take-log-msg {
  color: #e0e0e0;
}

/* Scheduled Load tab */
.load-tab-container {
  position: relative;
  background: white;
  color: #222;
  border-radius: 6px;
  padding: 20px;
  max-width: 900px;
}

.load-pending-badge {
  background: #1a5276;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.load-archived-badge {
  background: #666;
  color: white;
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.load-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
}

.load-date-label {
  font-weight: bold;
  color: #555;
  white-space: nowrap;
}

.load-date-input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
}

.load-date-input:focus {
  border-color: gold;
  outline: none;
}

.load-date-input:disabled {
  background: #f0f0f0;
  color: #666;
}

/* Dashboard — full-width when active, hide products sidebar */
body.dashboard-active #products,
body.dashboard-active #inputandtagbar,
body.dashboard-active #brandbar {
  display: none !important;
}

/* Dashboard view mode — hide menu/yard-bar for yard/admin until admin toggle is activated */
body.dashboard-view-mode #menu,
body.dashboard-view-mode #yard-bar {
  display: none !important;
}

body.dashboard-view-mode #tabs-content {
  padding: 2px;
}

body.dashboard-view-mode .dashboard-container {
  padding: 4px;
  border-radius: 0;
}

/* Customer mode — full-screen dashboard for non-yard/admin users */
body.customer-mode #menu,
body.customer-mode #products,
body.customer-mode #inputandtagbar,
body.customer-mode #brandbar {
  display: none !important;
}

body.customer-mode #tabs-content {
  padding: 2px;
}

body.customer-mode .dashboard-header {
  display: none;
}

body.customer-mode .dashboard-container {
  padding: 4px;
  border-radius: 0;
}

.dashboard-container {
  background: #091C48;
  color: white;
  border-radius: 6px;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid gold;
  flex-wrap: wrap;
}

.dashboard-title {
  margin: 0;
  color: gold;
  font-size: 1.3em;
}

.dash-selector {
  font-family: inherit;
  font-size: 1.1em;
  padding: 4px 8px;
  border: 1px solid gold;
  border-radius: 3px;
  min-width: 0;
  background: #091C48;
  color: white;
}

.dashboard-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.dash-btn {
  padding: 5px 12px;
  background: #091C48;
  color: white;
  border: 1px solid gold;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8em;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
}

.dash-btn:hover { background: #0d2660; }
.dash-btn-primary { background: #2a7d2a; border-color: #3a9a3a; }
.dash-btn-primary:hover { background: #34943a; }
.dash-btn-danger { background: #8b0000; border-color: #cc0000; }
.dash-btn-danger:hover { background: #cc0000; }
.dash-btn-sm { padding: 2px 8px; min-height: 24px; font-size: 0.75em; }

.dash-import-label {
  cursor: pointer;
}

.dashboard-empty {
  color: #aaa;
  font-style: italic;
  padding: 20px 0;
}

.dashboard-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-section {
  position: relative;
  flex: 1 1 300px;
  min-width: 350px;
  max-width: 450px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.dashboard-sections.masonry-layout {
  position: relative;
}

.dashboard-sections.masonry-layout .dashboard-section {
  max-width: none;
}

/* Title bar — coloured background behind section title + star */
.dash-title-bar {
  position: relative;
  padding: 4px 8px;
  margin: -8px -8px 6px -8px;
  border-radius: 3px 3px 0 0;
}

.dash-title-bar .dashboard-section-title {
  color: inherit;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.dash-title-bar .dash-section-fav-star {
  color: inherit;
  opacity: 0.7;
  top: 4px;
  right: 4px;
}

.dash-title-bar .dash-section-fav-star.active {
  opacity: 1;
}

.dash-custom-text .dashboard-section-title {
  color: inherit;
}

.dash-custom-text .dash-section-note {
  color: inherit;
  opacity: 0.85;
}

.dash-custom-text .dash-fav-star {
  color: inherit;
  opacity: 0.6;
}

.dash-custom-text .dash-fav-star.active {
  opacity: 1;
}

.dash-custom-text .dash-section-fav-star {
  color: inherit;
  opacity: 0.6;
}

.dash-custom-text .dash-section-fav-star.active {
  opacity: 1;
}

.dash-custom-text .dashboard-table th {
  color: inherit;
  opacity: 0.85;
}

.dash-custom-text .dash-sort-icon {
  color: inherit;
}

.dashboard-section-title {
  margin: 0 0 6px 0;
  font-size: 0.9em;
  color: gold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 4px;
  padding-right: 24px;
}

.dashboard-section-icon {
  margin-right: 6px;
  text-transform: none;
}

.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 4px;
}

.dashboard-section-head .dashboard-section-title {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.dash-unit-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 6px;
}

.dash-unit-label {
  font-size: 0.7em;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.dash-unit-label.active {
  color: gold;
  font-weight: bold;
}

.dash-unit-switch {
  transform: scale(0.8);
}

.dash-unit-switch .discount-toggle-slider {
  background-color: rgba(255, 215, 0, 0.4);
}

.dash-unit-switch input:checked + .discount-toggle-slider {
  background-color: gold;
}

.dashboard-table-wrap { overflow: hidden; max-width: 100%; }

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78em;
  line-height: 1.3;
}

.dashboard-table th {
  background: transparent;
  color: gold;
  padding: 3px 5px;
  text-align: left;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.dashboard-table td {
  padding: 2px 5px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.dashboard-table tbody tr:hover { background: rgba(255, 255, 255, 0.08); }

.dt-right { text-align: right; }
.dt-center { text-align: center; }
.dt-empty { text-align: center; color: #888; font-style: italic; padding: 8px; }

.dashboard-table th.dt-right { text-align: right; }
.dashboard-table th.dt-center { text-align: center; }

.dash-sortable {
  cursor: pointer;
  user-select: none;
}

.dash-sortable:hover {
  background: #0d2660;
}

.dash-sort-icon {
  font-size: 0.75em;
  opacity: 0.35;
  margin-left: 2px;
}

.dash-sort-active {
  opacity: 1;
}

.dash-sort-priority {
  font-size: 0.85em;
  margin-right: 1px;
  opacity: 0.75;
  color: gold;
}

.dash-sort-longpress {
  background: rgba(255, 215, 0, 0.25) !important;
  transition: background 0.15s ease;
}

/* Stock level visualisation — inline pack squares + loose indicator */
.stock-viz {
  display: inline-flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 1px;
  row-gap: 2px;
  vertical-align: middle;
}

.stock-viz-pack {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 1px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.stock-viz-pack:hover {
  opacity: 1;
}

.stock-viz-void {
  display: block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

.stock-viz-sep {
  display: flex;
  align-items: center;
  color: rgba(255, 215, 0, 0.5);
  font-size: 9px;
  line-height: 9px;
  flex-shrink: 0;
  padding: 0 1px;
  user-select: none;
}

.stock-viz-expected-svg {
  display: block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  vertical-align: middle;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.stock-viz-expected-svg:hover {
  opacity: 1;
}

.stock-viz-loose-svg {
  display: block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  vertical-align: middle;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.stock-viz-loose-svg:hover {
  opacity: 1;
}

.dash-section-note {
  font-size: 0.8em;
  color: #ccc;
  line-height: 1.5;
  padding: 4px 6px;
  white-space: pre-wrap;
}

.dash-section-note-above {
  margin-bottom: 4px;
}

.dash-section-note-below {
  margin-top: 4px;
}

.dash-section-note-input {
  flex: 1;
  min-width: 0;
  max-width: 400px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  resize: vertical;
  line-height: 1.4;
}

.dash-section-note-input:focus {
  border-color: gold;
  outline: none;
}

.dash-note-input {
  width: 100%;
  box-sizing: border-box;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.3;
  background: transparent;
  color: #e0e0e0;
}

.dash-note-input:focus {
  border-color: gold;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
}

.dash-note-input:hover:not(:focus) {
  border-color: rgba(255, 215, 0, 0.3);
}

.dash-cell-wrap {
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: break-word;
}

.dash-cell-wrap-normal {
  white-space: normal !important;
}

.dash-cell-wrap-break-all {
  white-space: normal !important;
  word-break: break-all;
}

.dash-section-fav-star {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  font-size: 0.9em;
  color: #555;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
  text-transform: none;
  z-index: 1;
}

.dash-section-fav-star:hover {
  color: gold;
}

.dash-section-fav-star.active {
  color: gold;
}

.dash-fav-star {
  cursor: pointer;
  font-size: 1.1em;
  color: #555;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}

.dash-fav-star:hover {
  color: gold;
}

.dash-fav-star.active {
  color: gold;
}

/* Dashboard legend — title/contact section and scheduled loads section */
.dashboard-legend-title {
  font-size: 1.15em;
  font-weight: bold;
  color: gold;
  margin-bottom: 4px;
}

.dashboard-legend-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85em;
  color: #ccc;
}

.dashboard-legend-details {
  color: #aaa;
}

.dashboard-legend-version {
  font-size: 0.7em;
  color: #555;
  margin-top: 4px;
  letter-spacing: 0.03em;
}

.dashboard-legend-loads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.dashboard-legend-load-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.dashboard-legend-load {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
}

.dashboard-legend-load-icon {
  flex-shrink: 0;
}

.dashboard-legend-load-name {
  color: #e0e0e0;
}

.dashboard-legend-load-date {
  color: #aaa;
  font-size: 0.9em;
}

.dashboard-legend-load[data-load-products] {
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 6px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-legend-load-active {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.4);
}

tr.dash-load-highlight {
  background: rgba(255, 215, 0, 0.15) !important;
}

.dashboard-legend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.dashboard-legend-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #777;
  font-family: inherit;
  font-size: 0.75em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-logout:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-fav-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-fav-filter:hover {
  color: gold;
  border-color: rgba(255, 215, 0, 0.3);
}

.dashboard-legend-fav-filter.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.dashboard-legend-instock-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.75em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-instock-filter:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-legend-instock-filter.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.dashboard-legend-version-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.75em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-version-btn:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
}

.dashboard-legend-admin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 1em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-admin-toggle:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-admin-toggle.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.dashboard-legend-fullscreen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #777;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-fullscreen:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-fullscreen.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.dashboard-legend-phone {
  display: none;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #777;
  font-family: inherit;
  font-size: 0.85em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-phone:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #777;
  font-family: inherit;
  font-size: 0.85em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-signal:hover {
  color: #3a76f0;
  border-color: rgba(58, 118, 240, 0.4);
  background: rgba(58, 118, 240, 0.08);
}

.dashboard-legend-signal img {
  display: block;
  width: 14px;
  height: 14px;
}

/* Dashboard inline stock take */
.dashboard-legend-stocktake {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-stocktake:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-stocktake.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

@keyframes dash-stock-pulse {
  0%   { background-color: rgba(255, 215, 0, 0.4); }
  100% { background-color: transparent; }
}

.dash-stock-pulse {
  animation: dash-stock-pulse 1.5s ease-out;
}

.dash-stock-row-clickable {
  cursor: pointer;
}

.dash-stock-row-clickable:hover {
  background: rgba(255, 215, 0, 0.12) !important;
}

.dash-stock-row-expanded {
  background: rgba(255, 215, 0, 0.08) !important;
}

.dash-stock-expanded-row td {
  padding: 0 !important;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3) !important;
}

.dash-stock-inline {
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 4px 4px;
}

.dash-stock-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.dash-stock-pack-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dash-stock-pack-label {
  min-width: 48px;
  font-weight: bold;
  font-size: 0.85em;
  color: #ccc;
  text-align: right;
}

.dash-stock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.dash-stock-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: gold;
}

.dash-stock-btn:active {
  background: rgba(255, 215, 0, 0.25);
  transform: scale(0.95);
}

.dash-stock-btn-med {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  font-size: 0.85em;
}

.dash-stock-input {
  width: 56px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 1em;
  font-weight: bold;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  -moz-appearance: textfield;
}

.dash-stock-input::-webkit-outer-spin-button,
.dash-stock-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dash-stock-input:focus {
  border-color: gold;
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}

.dash-stock-btn-remove {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px;
  font-size: 0.8em !important;
  color: #ff9999;
  border-color: rgba(255, 100, 100, 0.3);
  background: transparent;
  padding: 0;
}

.dash-stock-btn-remove:hover {
  color: #ff4444;
  border-color: rgba(255, 68, 68, 0.5);
  background: rgba(255, 0, 0, 0.1);
}

.dash-stock-add-size-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.dash-stock-new-size {
  width: 64px !important;
}

.dash-stock-new-size::placeholder {
  color: #888;
}

.dash-stock-loose-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.dash-stock-bulk-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.dash-stock-note-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.dash-stock-note {
  flex: 1;
  max-width: 200px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dash-stock-note:focus {
  border-color: gold;
  outline: none;
  background: rgba(255, 255, 255, 0.15);
}

.dash-stock-note::placeholder {
  color: #888;
}

.dash-stock-log-note {
  color: gold;
  font-style: italic;
  font-size: 0.95em;
}

.dash-stock-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-stock-save {
  padding: 6px 18px;
  background: rgba(42, 125, 42, 0.6);
  color: white;
  border: 1px solid rgba(42, 125, 42, 0.8);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  font-weight: bold;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
  transition: background 0.2s ease;
}

.dash-stock-save:hover {
  background: rgba(42, 125, 42, 0.8);
}

.dash-stock-save.dash-stock-saved {
  background: rgba(42, 125, 42, 0.3);
  color: #8f8;
}

.dash-stock-save.dash-stock-saved-offline {
  background: rgba(255, 165, 0, 0.5);
  color: #fff;
  border-color: #e0a458;
}

.dash-stock-offline-pending {
  background: rgba(255, 165, 0, 0.12) !important;
  border-left: 3px solid #e0a458;
}

.dash-stock-offline-msg {
  font-size: 0.75em;
  color: #e0a458;
  font-style: italic;
}

.dash-stock-meta {
  font-size: 0.75em;
  color: #888;
  font-style: italic;
}

.dash-stock-log {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.dash-stock-log-title {
  font-size: 0.75em;
  color: gold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.dash-stock-log-entry {
  font-size: 0.72em;
  color: #aaa;
  padding: 1px 0;
  line-height: 1.4;
}

.dash-stock-log-date {
  color: #888;
}

.dash-stock-log-who {
  color: #ccc;
  font-weight: bold;
}

.dash-stock-log-detail {
  color: #999;
}

/* Dashboard view detail (click-to-expand stock summary in view mode) */
.dash-view-detail-clickable {
  cursor: pointer;
}

.dash-view-detail-clickable:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.dash-view-detail-expanded {
  background: rgba(255, 215, 0, 0.06) !important;
}

.dash-view-detail-row td {
  padding: 0 !important;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3) !important;
}

.dash-view-detail {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 4px 4px;
  font-size: 0.82em;
  line-height: 1.6;
  white-space: normal;
  word-wrap: break-word;
}

.dash-view-detail-empty {
  color: #888;
  font-style: italic;
}

.dash-view-detail-text {
  color: #ccc;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.dash-view-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  font-size: 0.95em;
}

.dash-view-detail-expected {
  font-size: 1.25em;
  color: #e0a458;
  font-style: italic;
}

/* Product CSV import */
.dashboard-legend-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-import:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.product-import-overlay {
  z-index: 10000;
}

.product-import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.product-import-table th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 2px solid #ddd;
  color: #091C48;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.product-import-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.product-import-table tbody tr:hover {
  background: #f8f8f0;
}

.pi-row-invalid {
  opacity: 0.5;
}

.pi-tags-cell {
  font-size: 0.85em;
  color: #888;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-status-new {
  color: #2a7d2a;
  font-weight: bold;
  font-size: 0.85em;
}

.pi-status-update {
  color: #c47f17;
  font-weight: bold;
  font-size: 0.85em;
}

.pi-status-invalid {
  color: #c00;
  font-size: 0.85em;
}

.product-import-confirm {
  white-space: nowrap;
}

/* Product Editor (dashboard section — yard/admin) */
.dashboard-legend-product-editor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-product-editor:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-product-editor.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.pe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.pe-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.pe-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.pe-field-wide {
  flex: 1;
  min-width: 200px;
}

.pe-label {
  font-size: 0.72em;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pe-input {
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-sizing: border-box;
  width: 100%;
}

.pe-input:focus {
  border-color: gold;
  outline: none;
}

.pe-input[readonly] {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.pe-input {
  resize: vertical;
  min-height: 60px;
}

.pe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.pe-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 3px;
  font-size: 0.82em;
  white-space: nowrap;
  color: #e0e0e0;
}

.pe-tag-attr {
  color: #aaa;
  font-size: 0.9em;
}

.pe-chip-edit {
  cursor: pointer;
  color: #aaa;
  font-size: 0.8em;
  transition: color 0.15s ease;
}

.pe-chip-edit:hover {
  color: gold;
}

.pe-chip-remove {
  cursor: pointer;
  color: #ff9999;
  font-size: 0.85em;
}

.pe-chip-remove:hover {
  color: #ff4444;
}

.pe-tag-name-ro {
  color: #e0e0e0;
}

.pe-tag-edit-input {
  width: 120px !important;
  margin: 0 2px;
}

.pe-chip-input {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.82em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  width: 80px;
}

.pe-chip-input:focus {
  border-color: gold;
  outline: none;
}

.pe-chip-input::placeholder {
  color: #888;
}

.pe-attr-add {
  width: 150px;
}

.pe-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.pe-feedback {
  font-size: 0.82em;
  min-height: 1.4em;
  margin-top: 4px;
}

.pe-feedback-success {
  color: #8f8;
}

.pe-feedback-error {
  color: #ff6666;
}

.pe-section {
  overflow: visible !important;
}

.pe-list {
  margin-top: 8px;
}

.pe-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.pe-list-title {
  font-size: 0.85em;
  color: gold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pe-search {
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.82em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  flex: 1;
  max-width: 300px;
}

.pe-search:focus {
  border-color: gold;
  outline: none;
}

.pe-search::placeholder {
  color: #888;
}

.pe-tags-cell {
  font-size: 0.85em;
  color: #aaa;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pe-section .dashboard-table-wrap {
  overflow-x: auto;
}

.pe-table td:last-child {
  white-space: nowrap;
  overflow: visible;
}

.pe-editing-row {
  background: rgba(255, 215, 0, 0.12) !important;
}

.pe-list-hint {
  font-size: 0.78em;
  color: #888;
  font-style: italic;
  padding: 4px 0;
}

/* User Admin Panel (dashboard section) */
.dashboard-legend-useradmin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: #555;
  font-family: inherit;
  font-size: 0.85em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dashboard-legend-useradmin:hover {
  color: #ccc;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-legend-useradmin.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.1);
}

.ua-panel {
  padding: 4px 0;
}

.ua-toolbar {
  margin-bottom: 10px;
}

.ua-section {
  margin-bottom: 12px;
}

.ua-count {
  font-size: 0.75em;
  color: #aaa;
  margin-bottom: 4px;
}

.ua-table {
  font-size: 0.82em;
}

.ua-table td {
  vertical-align: middle;
}

.ua-id {
  font-family: monospace;
  font-size: 0.9em;
  color: #aaa;
  white-space: nowrap;
}

.ua-date {
  color: #888;
  font-size: 0.9em;
  white-space: nowrap;
}

.ua-you {
  color: gold;
  font-size: 0.8em;
  font-style: italic;
}

.ua-self-row {
  background: rgba(255, 215, 0, 0.05) !important;
}

.ua-role {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ua-role-admin { background: rgba(106, 27, 154, 0.3); color: #ce93d8; }
.ua-role-yard  { background: rgba(26, 82, 118, 0.3); color: #81d4fa; }
.ua-role-customer { background: rgba(42, 125, 42, 0.2); color: #a5d6a7; }

.ua-actions {
  white-space: nowrap;
}

.ua-actions .dash-btn {
  margin-right: 2px;
}

.ua-edit-row td {
  background: rgba(255, 215, 0, 0.08);
}

.ua-input, .ua-select {
  padding: 4px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-sizing: border-box;
}

.ua-input:focus, .ua-select:focus {
  border-color: gold;
  outline: none;
}

.ua-input-wide {
  width: 100%;
  min-width: 120px;
}

.ua-create-form {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.ua-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ua-label {
  min-width: 50px;
  font-size: 0.8em;
  color: #ccc;
  font-weight: bold;
}

.ua-form-actions {
  margin-top: 8px;
}

.ua-deleted-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* User admin activity log */
.ua-log-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.ua-log-header {
  margin-bottom: 6px;
}

.ua-log-entries {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ua-log-entry {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
  font-size: 0.75em;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ua-log-time {
  color: #888;
  flex-shrink: 0;
  min-width: 90px;
}

.ua-log-who {
  color: #ccc;
  font-weight: bold;
  flex-shrink: 0;
  min-width: 60px;
}

.ua-log-desc {
  color: #aaa;
}

.ua-log-desc strong {
  color: #e0e0e0;
  font-weight: bold;
}

/* User detail panel (expanded on row click) */
tr[data-ua="select-user"] { cursor: pointer; }
tr[data-ua="select-user"]:hover { background: rgba(255, 215, 0, 0.06); }

.ua-selected-row {
  background: rgba(255, 215, 0, 0.12) !important;
}

.ua-detail-panel {
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-left: 3px solid gold;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.ua-detail-loading {
  color: #888;
  font-style: italic;
  font-size: 0.85em;
}

.ua-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.ua-detail-title {
  font-weight: bold;
  color: gold;
}

.ua-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ua-detail-section {
  min-width: 0;
}

.ua-detail-section h4 {
  margin: 0 0 6px;
  color: gold;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  padding-bottom: 3px;
}

.ua-detail-row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  font-size: 0.78em;
  color: #ccc;
}

.ua-detail-label {
  color: #888;
  min-width: 55px;
  font-weight: bold;
  flex-shrink: 0;
}

.ua-detail-list {
  max-height: 180px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ua-detail-list-item {
  display: flex;
  gap: 8px;
  padding: 1px 0;
  font-size: 0.75em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  line-height: 1.4;
}

.ua-detail-list-time {
  color: #888;
  flex-shrink: 0;
  min-width: 95px;
}

.ua-detail-list-desc {
  color: #aaa;
}

.ua-detail-list-who {
  color: #666;
  font-size: 0.9em;
}

.ua-detail-empty {
  color: #666;
  font-style: italic;
  font-size: 0.78em;
  margin: 4px 0;
}

.ua-detail-fav-count {
  color: #aaa;
  font-size: 0.78em;
  margin: 0 0 6px;
}

.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px !important;
  background: rgba(255, 215, 0, 0.12) !important;
  border-color: rgba(255, 215, 0, 0.5) !important;
}

.view-as-text {
  font-size: 0.85em;
  color: #ccc;
}

.view-as-text strong {
  color: gold;
}

.view-as-exit {
  flex-shrink: 0;
}

.ua-passphrase {
  font-family: monospace;
  font-size: 1.4em;
  font-weight: bold;
  color: #091C48;
  background: #fffdf0;
  border: 2px solid gold;
  border-radius: 6px;
  padding: 16px 20px;
  text-align: center;
  letter-spacing: 0.1em;
  word-spacing: 0.3em;
  user-select: all;
}

/* Dashboard load editing (inline load builder) */
.dash-load-arrive-btn {
  cursor: pointer;
  font-size: 0.75em;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-left: 2px;
}

.dash-load-arrive-btn:hover {
  opacity: 1;
  filter: drop-shadow(0 0 3px #2a7d2a);
}

.dash-load-edit-btn {
  cursor: pointer;
  font-size: 0.75em;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-left: 2px;
}

.dash-load-edit-btn:hover {
  opacity: 1;
}

.dash-load-edit-btn.dash-load-edit-active {
  opacity: 1;
  filter: drop-shadow(0 0 3px gold);
}

.dash-load-edit-section {
  border-color: rgba(255, 215, 0, 0.5) !important;
  background: rgba(255, 215, 0, 0.08) !important;
}

.dash-load-edit-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.dash-load-name-input {
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  max-width: 200px;
}

.dash-load-name-input:focus {
  border-color: gold;
  outline: none;
}

.dash-load-date-label {
  font-size: 0.85em;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-load-date-input {
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-load-date-input:focus {
  border-color: gold;
  outline: none;
}

.dash-load-row-clickable {
  cursor: pointer;
}

.dash-load-row-clickable:hover {
  background: rgba(255, 215, 0, 0.08) !important;
}

.dash-load-row-inload {
  background: rgba(255, 215, 0, 0.12) !important;
  border-left: 3px solid gold;
}

.dash-load-row-expanded {
  background: rgba(255, 215, 0, 0.08) !important;
}

.dash-load-expanded-row td {
  padding: 0 !important;
  border-bottom: 2px solid rgba(255, 215, 0, 0.3) !important;
}

.dash-load-inline {
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 4px 4px;
}

.dash-load-packs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dash-load-pack-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dash-load-check {
  color: gold;
  font-weight: bold;
}

.dash-load-ok-btn {
  margin-top: 6px;
  display: block;
}

/* Dashboard footer — sign out + version at bottom */
.dashboard-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  margin-top: 8px;
}

/* Legend builder fields */
.dash-legend-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: #ccc;
  cursor: pointer;
  padding: 4px 0;
}

.dash-legend-toggle-label input {
  accent-color: gold;
}

.dash-legend-config {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.dash-legend-input {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  flex: 1;
  min-width: 0;
  max-width: 400px;
}

.dash-legend-input:focus {
  border-color: gold;
  outline: none;
}

/* Builder */
.dashboard-builder { background: #16213e; }
.dashboard-builder .dashboard-header { border-bottom-color: #2a7d2a; }

.dash-name-input {
  font-family: inherit;
  font-size: 1.1em;
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  flex: 1;
  max-width: 300px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-name-input:focus { border-color: gold; outline: none; }

.dash-layout-select {
  padding: 4px 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.dash-layout-select:focus {
  border-color: gold;
  outline: none;
}

.dashboard-builder-section {
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  min-width: 0;
}

.dash-builder-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dash-unit-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dash-unit-toggle-label.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.08);
}

.dash-unit-toggle-label input {
  accent-color: gold;
}

.dash-section-title-input {
  font-family: inherit;
  font-size: 0.95em;
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  flex: 1;
  max-width: 250px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-section-title-input:focus { border-color: gold; outline: none; }

.dash-section-icon-input {
  width: 36px;
  text-align: center;
  padding: 3px 4px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 1.1em;
  flex-shrink: 0;
}

.dash-section-icon-input:focus {
  border-color: gold;
  outline: none;
}

.dash-section-icon-color {
  width: 28px;
  height: 28px;
  padding: 1px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}

.dash-section-icon-color::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.dash-section-icon-color::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.dash-section-icon-color::-moz-color-swatch {
  border: none;
  border-radius: 2px;
}

.dash-builder-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dash-builder-label {
  font-weight: bold;
  color: #ccc;
  font-size: 0.8em;
  min-width: 80px;
  padding-top: 4px;
}

.dash-tag-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.dash-tag-chip, .dash-col-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #091C48;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.8em;
}

.dash-tag-not {
  background: rgba(200, 0, 0, 0.25);
  border: 1px solid rgba(255, 80, 80, 0.5);
}

.dash-tag-or {
  background: rgba(60, 120, 200, 0.25);
  border: 1px solid rgba(100, 160, 255, 0.5);
}

.dash-btn-or {
  background: rgba(60, 120, 200, 0.3);
  border-color: rgba(100, 160, 255, 0.6);
  font-weight: bold;
  font-size: 0.7em;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dash-btn-or:hover {
  background: rgba(60, 120, 200, 0.5);
}

.dash-btn-or-active {
  background: rgba(60, 120, 200, 0.6) !important;
  border-color: rgba(100, 180, 255, 0.9);
  color: #fff;
  box-shadow: 0 0 6px rgba(100, 160, 255, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dash-btn-or-active:hover {
  background: rgba(60, 120, 200, 0.7) !important;
}

.dash-tag-helper {
  font-size: 0.72em;
  color: #777;
  font-style: italic;
  line-height: 1.5;
  padding: 2px 0 0 0;
}

.dash-tag-helper-or {
  color: rgba(100, 160, 255, 0.9);
  font-weight: bold;
  font-style: normal;
}

.dash-tag-helper-not {
  color: rgba(255, 100, 100, 0.9);
  font-weight: bold;
  font-style: normal;
}

.dash-tag-remove, .dash-col-remove {
  cursor: pointer;
  color: #ff9999;
  font-size: 0.9em;
}

.dash-tag-remove:hover, .dash-col-remove:hover { color: #ff4444; }

.dash-tag-input {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  width: 120px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-tag-input:focus { border-color: gold; outline: none; }

.dash-col-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
  flex: 1;
  min-width: 0;
}

.dash-add-col-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.dash-col-type, .dash-col-attrs, .dash-col-label {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-col-type { min-width: 100px; }

.dash-default-sort-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.dash-default-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-default-sort-select,
.dash-default-sort-add {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-default-sort-select:focus,
.dash-default-sort-add:focus {
  border-color: gold;
  outline: none;
}

.dash-col-attrs { width: 140px; }
.dash-col-label { width: 100px; }

.dash-col-type:focus, .dash-col-attrs:focus, .dash-col-label:focus {
  border-color: gold;
  outline: none;
}

/* Column editing in builder */
.dash-col-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-col-idx {
  min-width: 20px;
  text-align: center;
  font-size: 0.75em;
  color: #888;
  flex-shrink: 0;
}

.dash-col-width {
  width: 52px;
  padding: 3px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: center;
  flex-shrink: 0;
}

.dash-col-width::placeholder {
  color: #666;
}

.dash-col-width:focus {
  border-color: gold;
  outline: none;
}

.dash-col-label-edit {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  flex: 1;
  min-width: 60px;
  max-width: 150px;
}

.dash-col-move {
  padding: 1px 5px;
  min-height: 20px;
  min-width: 20px;
  font-size: 0.75em;
  line-height: 1;
}

.dash-col-move:disabled,
.dash-section-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.dash-col-label-edit:focus { border-color: gold; outline: none; }

.dash-col-align {
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  min-width: 55px;
}

.dash-col-align:focus { border-color: gold; outline: none; }

.dash-col-hdr-align {
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  min-width: 55px;
}

.dash-col-hdr-align:focus { border-color: gold; outline: none; }

.dash-col-wrap-mode {
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  min-width: 55px;
}

.dash-col-wrap-mode:focus { border-color: gold; outline: none; }

.dash-col-wrap-char {
  width: 28px;
  padding: 2px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: center;
}

.dash-col-wrap-char:focus { border-color: gold; outline: none; }

/* Column group headers */
.dashboard-group-row th {
  padding: 3px 5px;
  font-size: 0.75em;
  color: white;
  background: transparent;
  border-bottom: none;
}

.dash-group-th {
  text-align: center !important;
  font-weight: bold;
  letter-spacing: 0.03em;
  background: transparent !important;
  border-bottom: none !important;
}

/* Vertical group boundary lines — header rows only */
.dashboard-table th.dash-group-start {
  border-left: 1px solid rgba(255, 215, 0, 0.25);
}

.dashboard-table th.dash-group-end {
  border-right: 1px solid rgba(255, 215, 0, 0.25);
}

/* Column groups in builder */
.dash-group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.dash-group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.85em;
}

.dash-group-title-text { font-weight: bold; color: gold; }
.dash-group-range { color: #aaa; font-size: 0.85em; }

.dash-col-drop-units-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75em;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dash-col-drop-units-label.active {
  color: gold;
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.08);
}

.dash-col-drop-units-label:hover {
  border-color: rgba(255, 215, 0, 0.3);
  color: #ccc;
}

.dash-col-drop-units-label.active:hover {
  color: gold;
}

.dash-col-drop-units {
  accent-color: gold;
  margin: 0;
  cursor: pointer;
}

.dash-group-from-edit,
.dash-group-to-edit {
  padding: 1px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-group-from-edit:focus,
.dash-group-to-edit:focus {
  border-color: gold;
  outline: none;
}

.dash-group-remove {
  cursor: pointer;
  color: #ff9999;
  font-size: 0.9em;
}

.dash-group-remove:hover { color: #ff4444; }

.dash-group-unit {
  padding: 1px 4px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.75em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  margin-left: auto;
}

.dash-group-unit:focus { border-color: gold; outline: none; }

.dash-add-group-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.dash-group-title-input {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  width: 120px;
}

.dash-group-title-input:focus { border-color: gold; outline: none; }

.dash-group-from,
.dash-group-to {
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-group-from:focus, .dash-group-to:focus { border-color: gold; outline: none; }
.dash-group-to-label { color: #aaa; font-size: 0.8em; }

.dash-builder-preview {
  margin-top: 8px;
  border-top: 1px dashed rgba(255, 215, 0, 0.2);
  padding-top: 6px;
}

.dash-preview-unit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 0;
}

.dash-preview-unit-hint {
  font-size: 0.75em;
  color: #c47f17;
  margin-bottom: 6px;
  font-style: italic;
}

.dash-preview-count {
  font-size: 0.75em;
  color: #aaa;
  margin-bottom: 4px;
}

/* Dashboard Discount Box */
.dash-discount-section {
  flex: 1 1 300px;
  min-width: 250px;
  max-width: 400px;
  padding: 6px 8px;
}

.dash-discount-group {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.dash-discount-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dash-discount-group-title {
  font-size: 0.68em;
  font-weight: bold;
  color: gold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.dash-discount-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.78em;
  color: #ccc;
  transition: background 0.15s ease;
  min-height: 22px;
}

.dash-discount-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dash-discount-switch {
  flex-shrink: 0;
  transform: scale(0.85);
}

.dash-discount-switch .discount-toggle-slider {
  background-color: rgba(255, 255, 255, 0.2);
}

.dash-discount-switch input:checked + .discount-toggle-slider {
  background-color: gold;
}

.dash-discount-label {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.dash-discount-rate {
  flex-shrink: 0;
  font-weight: bold;
  color: #e0a458;
  font-size: 0.88em;
  min-width: 24px;
  text-align: right;
}

.dash-custom-text .dash-discount-group-title {
  color: inherit;
  opacity: 0.85;
}

.dash-custom-text .dash-discount-label {
  color: inherit;
}

.dash-custom-text .dash-discount-rate {
  color: inherit;
  opacity: 0.85;
}

.dash-discount-profile-level {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
}

/* Discount builder editor (inside dashboard builder) */
.dash-discount-builder {
  padding: 4px 0;
}

.dash-discount-builder-group {
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.dash-discount-builder-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 4px 8px;
}

.dash-discount-item-label {
  flex: 1;
  min-width: 120px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.dash-discount-item-label:focus {
  border-color: gold;
  outline: none;
}

.dash-discount-item-rate {
  width: 52px;
  padding: 3px 4px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  text-align: center;
  -moz-appearance: textfield;
}

.dash-discount-item-rate::-webkit-outer-spin-button,
.dash-discount-item-rate::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dash-discount-item-rate:focus {
  border-color: gold;
  outline: none;
}

.dash-discount-item-pct {
  color: #888;
  font-size: 0.8em;
  flex-shrink: 0;
}

/* ==========================================================================
   12. HOME TAB
   ========================================================================== */

.home-tab-container {
  background-color: #091C48;
  color: white;
  padding: 20px;
  max-width: 800px;
}

.home-welcome h1 {
  color: gold;
  margin: 0 0 20px 0;
  font-size: 1.8em;
}

.home-section {
  margin-bottom: 24px;
}

.home-section h2 {
  color: gold;
  margin: 0 0 12px 0;
  font-size: 1.2em;
  border-bottom: 1px solid rgba(255, 215, 0, 0.3);
  padding-bottom: 6px;
}

.home-section p {
  line-height: 1.6;
  color: #ccc;
  margin: 0 0 12px 0;
}

.home-icon-guide {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.home-icon-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.home-icon-symbol {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  border: 1px solid gold;
  border-radius: 4px;
  background: rgba(255, 215, 0, 0.08);
}

.home-icon-desc {
  color: #ccc;
  line-height: 1.5;
  font-size: 0.95em;
  align-self: center;
}

.home-icon-desc strong {
  color: white;
}

/* Version History Tab */
.version-history-container {
  position: relative;
  background: white;
  color: #222;
  border-radius: 6px;
  padding: 20px;
  max-width: 900px;
}

.version-history-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid gold;
  padding-right: 36px;
}

.version-history-header h2 {
  margin: 0 0 4px 0;
  color: #091C48;
}

.version-history-current {
  font-size: 0.9em;
  color: #555;
  margin: 0;
}

.version-history-empty {
  color: #888;
  font-style: italic;
}

.version-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}

.version-history-table th {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 2px solid #ddd;
  color: #091C48;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.version-history-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.version-history-table tbody tr:hover {
  background: #f8f8f0;
}

.version-row-current {
  background: #fffdf0;
}

.version-row-current:hover {
  background: #fff8d0 !important;
}

.version-col-version {
  white-space: nowrap;
  font-family: monospace;
  color: #091C48;
}

.version-col-version code {
  font-size: 0.95em;
}

.version-col-message {
  color: #444;
}

.version-col-date {
  white-space: nowrap;
  color: #888;
  font-size: 0.9em;
}

.version-entry-badge {
  background: #091C48;
  color: white;
  font-size: 0.65em;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 4px;
}

/* ==========================================================================
   13. MOBILE RESPONSIVE — all overrides for screens ≤ 600px
   ========================================================================== */

@media (max-width: 600px) {

  /* --- Menu bar --- */
  #menu {
    grid-template: auto auto / 1fr auto auto auto auto auto auto auto;
    height: auto;
    min-height: 44px;
    padding: 4px 8px;
  }

  #title {
    grid-area: 1 / 1 / 2 / 2;
    padding: 6px 8px;
    font-size: 0.9em;
    border-right: none;
    align-self: end;
  }

  #orders_icon {
    grid-area: 1 / 3 / 2 / 4;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #templates_icon {
    grid-area: 1 / 4 / 2 / 5;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #new_order_button {
    grid-area: 1 / 2 / 2 / 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #stock_icon {
    grid-area: 1 / 5 / 2 / 6;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #loads_icon {
    grid-area: 1 / 6 / 2 / 7;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #dashboard_icon {
    grid-area: 1 / 7 / 2 / 8;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #profile_icon {
    grid-area: 1 / 8 / 2 / 9;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #tabs-header {
    grid-area: 2 / 1 / 3 / 9;
    justify-self: stretch;
    padding: 2px 0;
  }

  .tab-header {
    padding: 4px 8px;
    min-width: 70px;
    font-size: 0.85em;
  }

  .tab-title {
    max-width: 90px;
  }

  /* --- Tab content --- */
  #tabs-content {
    padding: 8px;
  }

  /* --- Order tab --- */
  .order-tab-container {
    padding: 12px;
  }

  .order-title-bar {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .order-title-bar .order-name {
    font-size: 1.1em;
    min-width: 80px;
  }

  .order-dates {
    margin-left: auto;
    order: 2;
  }

  .order-created-date {
    font-size: 0.72em;
  }

  .order-updated-date {
    font-size: 0.68em;
  }

  /* Order items — compact single-line rows */
  .order-header-row {
    display: none;
  }

  .order-item-row {
    grid-template-columns: 24px minmax(0, 1fr) auto auto;
    gap: 4px;
    padding: 4px 0;
    font-size: 0.85em;
    align-items: start;
  }

  .order-total-row {
    grid-template-columns: 1fr auto;
    gap: 4px;
    padding: 6px 0;
  }

  .order-total-row .order-col-remove,
  .order-total-row .order-col-qty {
    display: none;
  }

  .order-col-price {
    display: none;
  }

  .order-col-item {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 4px;
  }

  .order-col-item .item-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
  }

  .order-col-item.expanded .item-text {
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .item-expand-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.6em;
    color: #999;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .order-col-item.expanded .item-expand-btn {
    color: #091C48;
  }

  .order-col-qty {
    gap: 2px;
    flex-shrink: 0;
  }

  .order-col-total {
    min-width: 50px;
    flex-shrink: 0;
  }

  .qty-btn {
    min-width: 28px;
    min-height: 28px;
    width: 28px;
    height: 28px;
    font-size: 0.9em;
  }

  .qty-value {
    min-width: 36px;
    font-size: 0.85em;
  }

  .qty-input {
    width: 52px;
    font-size: 16px;
    min-width: 36px;
    padding: 2px;
  }

  .remove-btn {
    min-width: 24px;
    min-height: 28px;
    width: 24px;
    height: 28px;
    font-size: 0.8em;
  }

  .order-subtotal-row {
    grid-template-columns: 1fr auto;
  }

  .order-subtotal-row .order-col-remove,
  .order-subtotal-row .order-col-qty,
  .order-subtotal-row .order-col-price {
    display: none;
  }

  .order-reference-input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* --- Delivery section --- */
  .order-delivery-section {
    padding: 8px;
    margin: 10px 0;
  }

  .delivery-option {
    padding: 8px 10px;
    font-size: 0.9em;
  }

  /* --- Address sections --- */
  .order-address-section {
    padding: 8px;
    margin-top: 10px;
  }

  .order-address-fields {
    max-width: 100%;
  }

  .order-billing-actions {
    flex-direction: column;
    gap: 6px;
  }

  .order-link-btn {
    width: 100%;
    text-align: center;
    padding: 8px 10px;
  }

  /* --- Delivery notes --- */
  .delivery-notes-field {
    max-width: 100%;
  }

  .delivery-notes-input {
    width: 100%;
  }

  .delivery-notes-preview {
    max-width: 100%;
  }

  /* --- Quotation notes --- */
  .quotation-notes-input {
    max-width: 100%;
    font-size: 16px;
  }

  /* --- Grand total --- */
  .order-grand-total {
    padding: 8px;
    margin: 10px 0;
  }

  .order-total-line {
    justify-content: space-between;
    gap: 8px;
  }

  .order-total-line .order-total-label {
    min-width: auto;
    text-align: left;
  }

  /* Discount block on narrow screens — allow full width */
  .order-discounts-block {
    min-width: 0;
    width: 100%;
  }

  /* Discount rows on narrow screens */
  .order-discount-line .discount-label-desc {
    font-size: 0.75em;
  }

  /* --- Order actions --- */
  .order-actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }

  .order-action-btn {
    width: 100%;
    text-align: center;
  }

  /* --- Products panel --- */
  #products {
    max-height: 40vh;
    padding: 4px 8px;
  }

  /* Products list view — collapse to 3 columns */
  .products-list-header {
    grid-template-columns: 1fr var(--pack-size-col-width, 80px) 60px;
    font-size: 0.75em;
  }

  .products-list-row {
    grid-template-columns: 1fr var(--pack-size-col-width, 80px) 60px;
    padding: 6px 6px;
    font-size: 0.85em;
  }

  .list-col-actions {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    justify-content: center;
  }

  .list-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }

  .list-action-price {
    display: block;
    color: gold;
    white-space: nowrap;
  }

  .product-add-actions {
    gap: 4px;
  }

  .list-col-decanted,
  .list-col-pack {
    display: none;
  }

  .products-list-header .list-col-decanted,
  .products-list-header .list-col-pack {
    display: none;
  }

  .list-col-actions button {
    min-height: 36px;
    min-width: 32px;
    padding: 4px 8px;
  }

  /* Products card view — narrower cards */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
  }

  .product-card {
    padding: 10px;
  }

  .card-add-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 4px 10px;
  }

  /* --- Yard bar --- */
  #yard-bar {
    padding: 4px 8px;
    font-size: 0.85em;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* --- Brand bar --- */
  #brandbar {
    padding: 4px 8px;
    gap: 6px;
  }

  .brand-tag {
    padding: 0.4em 0.8em;
    font-size: 0.85em;
    min-height: 36px;
  }

  /* --- Input and tag bar --- */
  #inputandtagbar {
    grid-template: auto auto / 1fr;
    padding: 4px 8px;
    gap: 6px;
  }

  #tagbar {
    padding: 4px 0;
  }

  #inputtext {
    width: 100%;
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding-right: 2.5em;
  }

  .input-clear-btn {
    min-width: 36px;
    min-height: 36px;
    right: 4px;
    font-size: 1.4em;
  }

  .tag {
    padding: 0.5em 0.6em;
    font-size: 0.85em;
    min-height: 36px;
    min-width: 36px;
  }

  /* --- Profile tab --- */
  .profile-tab-container {
    padding: 10px;
    overflow-x: hidden;
  }

  .profile-name-edit input {
    max-width: 100%;
    width: 100%;
    font-size: 16px;
  }

  .profile-dashboard {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-section {
    overflow: hidden;
  }

  .profile-field input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  .profile-actions {
    flex-direction: column;
    gap: 10px;
  }

  .profile-actions button {
    width: 100%;
    text-align: center;
  }

  /* Account level — stack badge above discount text on narrow screens */
  .account-level-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .email-display {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .email-line {
    max-width: 100%;
  }

  .email-edit-form input {
    max-width: 100%;
    width: 100%;
    font-size: 16px;
  }

  .address-display {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .address-letter-box {
    max-width: 100%;
    width: 100%;
    min-width: auto;
    box-sizing: border-box;
    padding: 12px 16px;
  }

  .profile-address-form input {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* --- Product detail tab --- */
  .product-detail-container {
    padding: 12px;
  }

  .product-detail-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 16px;
  }

  .product-detail-gallery {
    max-width: 250px;
  }

  .product-detail-actions {
    flex-direction: column;
    gap: 8px;
  }

  .product-detail-actions .order-action-btn {
    width: 100%;
    text-align: center;
  }

  .detail-action-row {
    flex-direction: column;
    gap: 8px;
  }

  .detail-action-row .order-action-btn {
    width: 100%;
    text-align: center;
  }


  .product-detail-price-row {
    padding: 6px 8px;
  }

  .spec-tags .tag {
    font-size: 0.8em;
    min-height: 28px;
    padding: 0.3em 0.5em;
  }

  /* --- Stock take section --- */
  .stock-pack-row,
  .stock-loose-row,
  .stock-add-size-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .stock-pack-label,
  .stock-loose-label {
    min-width: auto;
    width: 100%;
  }

  .stock-pack-input,
  .stock-loose-input,
  .stock-new-size-input {
    font-size: 16px;
  }

  .stock-qty-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5em;
  }

  .stock-qty-btn-med,
  .stock-qty-btn-lg {
    height: 48px;
    font-size: 1.1em;
  }

  .stock-loose-row {
    justify-content: flex-start;
  }

  .stock-image-item {
    width: 70px;
    height: 70px;
  }

  .stock-desc-input {
    max-width: 100%;
    font-size: 16px;
  }

  .stock-add-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-link-label-input,
  .stock-link-url-input {
    width: 100%;
    font-size: 16px;
  }

  .stock-take-scan-input {
    font-size: 16px;
  }

  /* --- Order items in profile lists --- */
  .order-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
  }

  .order-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .order-item button {
    min-height: 40px;
  }

  .template-save-field input {
    font-size: 16px;
  }

  /* --- Home tab --- */
  .home-tab-container {
    padding: 12px;
  }

  .home-welcome h1 {
    font-size: 1.4em;
  }

  /* --- Scheduled load tab --- */
  .load-tab-container { padding: 12px; }
  .load-date-row { flex-wrap: wrap; gap: 8px; }
  .load-date-input { font-size: 16px; }

  /* --- Dashboard --- */
  .dashboard-legend-fullscreen { display: none !important; }
  .dashboard-legend-phone {
    display: inline-flex;
    color: gold;
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
  }
  .dashboard-legend-phone:hover {
    color: #fff;
    border-color: gold;
    background: rgba(255, 215, 0, 0.25);
  }
  .dashboard-legend-actions {
    gap: 10px;
  }
  .dashboard-legend-fav-filter,
  .dashboard-legend-instock-filter,
  .dashboard-legend-phone,
  .dashboard-legend-signal,
  .dashboard-legend-version-btn,
  .dashboard-legend-admin-toggle,
  .dashboard-legend-stocktake,
  .dashboard-legend-useradmin,
  .dashboard-legend-import,
  .dashboard-legend-product-editor {
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
  }
  .dashboard-legend-stocktake {
    font-size: 1.1em;
  }
  .dash-stock-btn {
    width: 44px;
    height: 44px;
    font-size: 1.4em;
  }
  .dash-stock-btn-med {
    width: auto;
    min-width: 44px;
    height: 44px;
    font-size: 1em;
  }
  .dash-stock-input {
    width: 60px;
    font-size: 16px;
    height: 44px;
  }
  .dash-stock-btn-remove {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    font-size: 0.9em !important;
  }
  .dash-stock-new-size {
    width: 64px !important;
    height: 44px;
    font-size: 16px;
  }
  .dash-stock-packs {
    flex-direction: column;
  }
  .dash-stock-pack-label {
    min-width: 40px;
  }
  .dash-stock-loose-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .dash-stock-bulk-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .dash-stock-note {
    font-size: 16px;
    max-width: none;
  }
  .dash-load-name-input { font-size: 16px; }
  .dash-load-date-input { font-size: 16px; }
  .dash-load-packs { flex-direction: column; }
  .dash-load-edit-controls { gap: 8px; }
  .dashboard-legend-fav-filter {
    font-size: 1.1em;
  }
  .dashboard-legend-instock-filter,
  .dashboard-legend-version-btn {
    font-size: 0.95em;
  }
  .dashboard-legend-phone {
    font-size: 1.1em;
  }
  .dashboard-legend-signal {
    font-size: 1.1em;
  }
  .dashboard-legend-signal img {
    width: 18px;
    height: 18px;
  }
  .dashboard-section { flex: 1 1 100%; min-width: 0; }
  .dashboard-container { padding: 10px; }
  .dashboard-table { font-size: 3.2vw; }
  .ua-input, .ua-select { font-size: 16px; }
  .ua-form-row { flex-wrap: wrap; }
  .ua-table { font-size: 2.8vw; }
  .ua-passphrase { font-size: 1.1em; padding: 12px; }
  .ua-detail-grid { grid-template-columns: 1fr; }
  .dash-name-input { max-width: 100%; font-size: 16px; }
  .dash-section-title-input { max-width: 100%; font-size: 16px; }
  .dash-tag-input, .dash-col-type, .dash-col-attrs, .dash-col-label, .dash-col-label-edit, .dash-col-width, .dash-col-align, .dash-col-hdr-align, .dash-col-wrap-mode, .dash-col-wrap-char, .dash-group-title-input, .dash-group-from, .dash-group-to, .dash-group-unit .dash-section-note-input, .dash-group-from-edit, .dash-group-to-edit, .dash-layout-select, .dash-legend-input, .dash-section-icon-input, .dash-default-sort-select, .dash-default-sort-add, .pe-input, .pe-chip-input, .pe-search { font-size: 16px; }

  /* --- Dashboard discount box --- */
  .dash-discount-section { flex: 1 1 100%; min-width: 0; max-width: none; }
  .dash-discount-item { min-height: 30px; padding: 3px 8px; }
  .dash-discount-item-label, .dash-discount-item-rate { font-size: 16px; }
  .dash-section-bg-color, .dash-section-text-color, .dash-section-border-color, .dash-strip-bg, .dash-section-title-color { width: 36px; height: 36px; }

  /* --- Version history tab --- */
  .version-history-container { padding: 12px; }
  .version-history-table { font-size: 0.8em; }
  .version-col-date { display: none; }

  /* --- Login --- */
  .login-container {
    padding: 1.5rem;
    max-width: 100%;
  }
}

/* ==========================================================================
   14. TABLET RESPONSIVE — medium screens (601–900px)
   ========================================================================== */

@media (max-width: 900px) and (min-width: 601px) {

  .order-header-row,
  .order-item-row,
  .order-total-row {
    grid-template-columns: 36px 1fr 120px 80px 80px;
    gap: 6px;
  }

  .products-list-header,
  .products-list-row {
    grid-template-columns: 1fr 65px 65px var(--pack-size-col-width, 90px) 80px;
    gap: 6px;
  }

  .order-address-fields {
    max-width: 100%;
  }

  .profile-field input {
    max-width: 100%;
  }

  .dashboard-section { flex-basis: 280px; }
}

/* ==========================================================================
   15. LANDSCAPE LAYOUT — products sidebar on left, tab content on right
       Applies on landscape screens 901px+ wide
   ========================================================================== */
@media (orientation: landscape) and (min-width: 901px) {
  body {
    display: grid;
    grid-template-columns: 600px 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "menu     menu"
      "yard     yard"
      "products tabs"
      "search   tabs"
      "brand    tabs";
  }

  #menu {
    grid-area: menu;
  }

  #yard-bar {
    grid-area: yard;
  }

  #tabs-content {
    grid-area: tabs;
  }

  #products {
    grid-area: products;
    max-height: none;
    min-height: 0;
    border-top: none;
    border-right: 1px solid gold;
  }

  #inputandtagbar {
    grid-area: search;
    border-right: 1px solid gold;
    grid-template: auto auto / 1fr;
  }


  #brandbar {
    grid-area: brand;
    border-right: 1px solid gold;
  }

  /* Sidebar product list — compact columns for narrow sidebar */
  .products-list-header {
    grid-template-columns: 1fr 0.5fr 0.5fr; /*1fr var(--pack-size-col-width, 80px) 60px;*/
    /*grid-template-columns: 1fr var(--pack-size-col-width, 80px) 60px;*/
  }

  .products-list-row {
    grid-template-columns: 1fr 0.5fr 0.5fr; /*1fr var(--pack-size-col-width, 80px) 60px;*/
    /*grid-template-columns: 1fr var(--pack-size-col-width, 80px) 60px;*/
  }

  .list-col-decanted,
  .list-col-pack,
  .products-list-header .list-col-decanted,
  .products-list-header .list-col-pack {
    display: none;
  }

  .list-action-price {
    display: block;
    color: gold;
    white-space: nowrap;
  }

  .list-col-actions {
    display: grid;
    grid-template: auto / 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .list-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
  }

  #products-toggle {
    display: none;
  }

  body.dashboard-active,
  body.customer-mode,
  body.dashboard-view-mode {
    grid-template-columns: 1fr;
    grid-template-areas:
      "menu"
      "yard"
      "tabs";
  }
}
