/* Chubby Operations Platform — stylesheet
   Extracted from pricing_calculator.html's inline <style> block in v2.216
   (file-splitting effort — see CLAUDE_BRIEF.md "Splitting the monolith").
   Served by server.py at GET /styles.css. */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface2: #f0f0ee;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.14);
  --text: #1a1a18;
  --text2: #6b6b67;
  --text3: #9b9b97;
  --accent: #F1880D;
  /* (v2.82) Chubby brand palette — primary orange + warm brown + cream
     accent. Lifted from the eBay listing template, which is the existing
     source of truth for our customer-facing colours. Used for sidebar
     active state, primary buttons, calc-product-label, and assorted
     emphasis chips throughout the app. */
  --brand: #F1880D;
  --brand-dark: #8A3B29;
  --brand-bg: #FFF1DC;
  --brand-bg2: #FBE5C5;
  --green: #166534; --green-bg: #dcfce7; --green-text: #14532d;
  --amber: #92400e; --amber-bg: #fef3c7; --amber-text: #78350f;
  --red: #991b1b; --red-bg: #fee2e2; --red-text: #7f1d1d;
  --blue: #1e40af; --blue-bg: #dbeafe; --blue-text: #1e3a8a;
  --purple: #6d28d9; --purple-bg: #ede9fe; --purple-text: #4c1d95;
  --sidebar-w: 200px;
  --radius: 8px;
  --radius-lg: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}
/* ---- LAYOUT ---- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--text);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.sidebar-logo {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sidebar-logo-img {
  /* (v2.82) Full-width Chubby Mealworms wordmark + bird. Sits on a light
     panel so the brown/orange branding pops against the dark sidebar.
     The logo file lives on Shopify's CDN (same one the eBay listing
     template uses) so there's no asset to deploy with the app. */
  width: 100%;
  height: 64px;
  background-color: rgba(255,255,255,0.95);
  background-image: url('https://cdn.shopify.com/s/files/1/1110/2018/files/NEW-CHUBBY-LOGO_eec9dc13-3080-4ef0-bdb5-b2486df837b5.png?v=1715610430');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 8px;
  padding: 6px;
}
.sidebar-logo span {
  font-size: 10.5px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.12s;
  border-left: 2px solid transparent;
  font-weight: 400;
}
.nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: var(--brand); font-weight: 500; }
.nav-icon { width: 15px; height: 15px; opacity: 0.7; flex-shrink: 0; }
.nav-item.active .nav-icon { opacity: 1; }
/* (v2.181) Promotions right-hand submenu — see #tab-promotions. */
.promo-menu-btn:hover { background: var(--surface2) !important; }
.promo-menu-btn.active { background: var(--blue-bg) !important; color: var(--blue-text) !important; border-color: var(--blue) !important; font-weight: 600; }
.nav-section { padding: 14px 18px 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: rgba(255,255,255,0.25); text-transform: uppercase; }
/* (v2.82) Dashboard cards. Grid auto-fits at min 240px so we get 2-up on
   smaller screens and 4-up wide. Each card has a stat slot + label slot
   + optional trend / status footer. Pending cards get a dashed border
   to make it obvious they're not live yet. */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 132px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dash-card:hover { border-color: var(--border2); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.dash-card.pending { border-style: dashed; border-color: var(--border2); background: var(--surface2); }
.dash-card.pending .dash-card-value { color: var(--text3); }
.dash-card.brand-accent { border-left: 3px solid var(--brand); }
.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-card-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dash-card-sub {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 2px;
}
.dash-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: var(--text2);
}
.dash-card-pill {
  display: inline-block;
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-bg);
  color: var(--brand-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-card.pending .dash-card-pill { background: var(--surface); color: var(--text3); border: 1px solid var(--border2); }

/* (v2.110) Monthly sales targets widget. Sits above the dash-grid and
   shows progress bars per channel + total with a vertical pace marker
   at "where we should be today" (linear pro-rata across the month). */
.targets-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.targets-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.targets-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.targets-header .targets-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.targets-edit-btn {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--brand-bg);
  color: var(--brand-dark);
  border: 1px solid var(--brand);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.targets-edit-btn:hover { background: var(--brand); color: #fff; }
/* (v2.176) Back/forward month nav arrows next to the targets heading. */
.targets-nav {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.targets-nav-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.targets-nav-btn:hover:not(:disabled) { background: var(--brand-bg); color: var(--brand-dark); border-color: var(--brand); }
.targets-nav-btn:disabled { opacity: 0.35; cursor: default; }
.targets-row {
  display: grid;
  grid-template-columns: 110px 1fr 160px;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.targets-row:last-child { border-bottom: none; }
.targets-row.total { padding-top: 14px; padding-bottom: 14px; font-weight: 600; }
.targets-row.total .targets-label { color: var(--brand-dark); }
.targets-row.muted { opacity: 0.55; }
.targets-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.targets-label-meta {
  display: block;
  font-size: 10.5px;
  color: var(--text3);
  font-weight: 400;
  margin-top: 1px;
  text-transform: none;
  letter-spacing: 0;
}
.targets-bar-wrap {
  position: relative;
}
.targets-bar-track {
  position: relative;
  height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
}
.targets-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #F1880D 0%, #E07505 100%);
  border-radius: 11px;
  transition: width 0.4s ease;
}
.targets-bar-fill.behind { background: linear-gradient(90deg, #d97706 0%, #92400e 100%); }
.targets-bar-fill.ahead  { background: linear-gradient(90deg, #16a34a 0%, #166534 100%); }
.targets-bar-pace {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--text);
  z-index: 2;
  border-radius: 1px;
}
.targets-bar-pace::after {
  content: 'TODAY';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text2);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.targets-status {
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.targets-status-amount {
  font-weight: 600;
  color: var(--text);
}
.targets-status-line {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.targets-status-line.behind { color: #b45309; }
.targets-status-line.ahead  { color: #166534; }
.targets-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}
.targets-empty a {
  color: var(--brand-dark);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 720px) {
  .targets-row { grid-template-columns: 90px 1fr; }
  .targets-status { grid-column: 1 / -1; text-align: left; padding-left: 90px; }
  .targets-bar-pace::after { display: none; }
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}
.topbar-title { font-size: 14px; font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.panel { display: none; }
.panel.active { display: block; }

/* ---- COMPONENTS ---- */
.btn {
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); }
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { opacity: 0.85; }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-danger { color: var(--red); border-color: rgba(153,27,27,0.25); }
.btn-danger:hover { background: var(--red-bg); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-good { background: var(--green-bg); color: var(--green-text); }
.badge-warn { background: var(--amber-bg); color: var(--amber-text); }
.badge-bad { background: var(--red-bg); color: var(--red-text); }
.badge-info { background: var(--blue-bg); color: var(--blue-text); }
.badge-neutral { background: var(--surface2); color: var(--text2); }
.badge-kit { background: var(--purple-bg); color: var(--purple-text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

/* ---- METRICS ROW ---- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.metric-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; font-weight: 500; letter-spacing: 0.02em; }
.metric-value { font-size: 24px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -0.02em; }
.metric-value.good { color: var(--green); }
.metric-value.warn { color: var(--amber); }
.metric-value.bad { color: var(--red); }

/* ---- TABLE ---- */
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.tbl-wrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl-wrap th { background: var(--surface2); padding: 9px 12px; text-align: left; font-weight: 500; font-size: 11px; color: var(--text2); border-bottom: 1px solid var(--border); white-space: nowrap; letter-spacing: 0.02em; }
.tbl-wrap td { padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tbl-wrap tr:last-child td { border-bottom: none; }
.tbl-wrap tr:hover td { background: #fafaf9; }
.tbl-wrap .alert-row td:first-child { border-left: 3px solid #f59e0b; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ff { display: flex; flex-direction: column; gap: 4px; }
.ff.full { grid-column: 1/-1; }
.ff label { font-size: 11px; font-weight: 500; color: var(--text2); letter-spacing: 0.02em; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 0.12s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,26,24,0.06); }
input[type="number"] { font-family: 'DM Mono', monospace; }

/* ---- MODAL ---- */
/* v2.35 — Edit product is now a FULL PAGE (was a modal popup). The
   modal-overlay div is repurposed as a viewport-filling container that
   leaves the sidebar visible. Open/close still toggles the .open class
   on this element, so all existing openModal/closeModal JS keeps working
   unchanged. */
/* (v2.51) The "modal" is no longer a modal — it lives inline inside the
   Price Calculator tab as the channel-aware Product Data editor. The
   .modal-overlay wrapper survives only because dozens of selectors and
   handlers reference its DOM; we strip every overlay property so it
   renders as a regular block element. JS moves it into #tab-calculator
   at init. The `.open` class is kept set permanently while a product is
   loaded so all the original show/hide JS keeps working. */
.modal-overlay {
  display: none;
  background: transparent;
  margin-top: 0;
  /* (v2.52) Generous bottom padding so the sticky Save bar at the bottom
     of the viewport doesn't cover the last fields (Shopify collections
     picker, image grid, etc.). 140px clears the ~50px sticky bar plus
     a comfortable scroll margin. */
  padding-bottom: 140px;
}
.modal-overlay.open { display: block; }
.modal {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 20px; font-weight: 600; margin: 0; }
/* Sticky action bar at the bottom of the calculator tab — Save / Delete
   always reachable without scrolling to the end of long product forms.
   Sits below the channel form, above the page bottom. Still sticky-fixed
   so it floats at the bottom of the viewport while the user scrolls
   through fields. */
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  background: var(--surface);
  padding: 12px 36px;
  border-top: 1px solid var(--border);
  z-index: 60;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
/* Modal-ch-tabs row inside the embedded editor is now redundant — the
   Price Calc's calc-ch-tabs drive panel visibility instead. Hide. */
.modal-ch-tabs-wrap { display: none !important; }
@media (max-width: 768px) {
  .modal-foot { left: 48px; padding: 10px 16px; }
}

/* ---- COST BOX ---- */
.cost-box { background: var(--surface2); border-radius: var(--radius); padding: 12px 14px; }
.cost-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.cost-row:last-child { border-bottom: none; font-weight: 600; padding-top: 8px; }
.cost-row span:last-child { font-family: 'DM Mono', monospace; }

/* ---- CHANNEL CARDS ---- */
.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.ch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
/* Lists tab: collapsible section accordion */
.list-section { border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; background:var(--bg); }
.list-section-header { display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; user-select:none; background:var(--surface); border-radius:var(--radius) var(--radius) 0 0; border-bottom:1px solid var(--border); }
.list-section.collapsed .list-section-header { border-bottom:none; border-radius:var(--radius); }
.list-section-header:hover { background:var(--surface2); }
.list-section-chevron { display:inline-block; font-size:10px; color:var(--text2); transition:transform 0.15s; width:12px; text-align:center; }
.list-section.collapsed .list-section-chevron { transform:rotate(-90deg); }
.list-section-title { font-size:13px; font-weight:600; color:var(--text); flex:1; }
.list-section-count { font-size:11px; color:var(--text3); font-weight:400; }
.list-section-action { margin-left:auto; }
.list-section-body { padding:14px; }
.list-section.collapsed .list-section-body { display:none; }
/* Edit-modal channel sections (Website / eBay / Amazon) — collapsible by
   default to keep the modal tidy. Click the header to expand. Header
   action buttons (✨ Optimise, Generate with Claude, Open in calculator)
   are kept in the header so they're always one click away. */
.ch-section { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ch-section-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; border-radius: var(--radius); transition: background-color .15s ease; }
.ch-section-header:hover { background: var(--surface2); }
.ch-section-chevron { display: inline-block; font-size: 10px; color: var(--text2); transition: transform .18s ease; width: 12px; text-align: center; flex-shrink: 0; }
.ch-section:not(.collapsed) .ch-section-chevron { transform: rotate(90deg); }
.ch-section-title { font-size: 11.5px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; flex: 1; margin: 0; }
.ch-section-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ch-section-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.ch-section-body > .ff:first-child { margin-top: 6px; }
.ch-section.collapsed .ch-section-body { display: none; }
.ch-section.collapsed .ch-section-header { border-bottom: none; }
/* Edit-modal channel tabs (Website / eBay / Amazon) — v2.33 replaces the
   v2.32 collapsibles with a proper tab UI to mirror the Price Calculator's
   channel tabs. Active tab is remembered per-browser via localStorage. */
.modal-ch-tabs { display: flex !important; flex-wrap: wrap !important; gap: 4px !important; border-bottom: 2px solid var(--border); margin: 12px 0 0; overflow: visible !important; align-items: stretch !important; }
.modal-ch-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 18px !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -2px;
  transition: color .15s ease, border-color .15s ease;
  /* Force visibility on every tab regardless of position. The flex
     `auto` basis + min-width 0 default were collapsing the first and
     last children to zero width on some browsers — these !important
     rules guarantee each button keeps its content width. */
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  width: auto !important;
  height: auto !important;
  min-width: 60px !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  box-sizing: content-box !important;
}
.modal-ch-tab:hover { color: var(--text); }
.modal-ch-tab.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.modal-ch-panel { padding: 16px 0 8px; }
.modal-ch-panel.hidden { display: none; }
.modal-ch-panel-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 10px; }
/* v2.34 — tab system extended: tabs sit at the very TOP of the modal, with
   a "Product" tab covering all general/shared/logistics fields. Setting a
   non-product tab applies .tab-hidden to those general fields. */
.tab-hidden { display: none !important; }
.modal-ch-tabs-wrap { padding: 0 0 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.modal-ch-tabs-wrap .modal-ch-tabs { margin: 0; flex: 1 1 auto; }
#force-export-current-tab:hover { background: var(--surface2) !important; }
/* Image drop zone (v2.27) — used inside Edit modal for product images */
.img-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; background: var(--surface); }
.img-dropzone:hover { background: var(--surface2); }
.img-dropzone.dz-hover { background: var(--surface2); border-color: var(--blue); border-style: solid; }
.img-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.img-card img { display: block; width: 100%; height: 110px; object-fit: contain; background: #fff; }
.img-card .img-card-foot { display:flex; gap:4px; padding:4px; background:var(--surface2); border-top:1px solid var(--border); }
.img-card .img-card-foot button { flex: 1; font-size: 10.5px; padding: 3px 4px; }
.img-card .img-slot { position:absolute; top:4px; left:4px; background: rgba(0,0,0,0.55); color:#fff; font-size: 10px; font-family:'DM Mono',monospace; padding: 1px 5px; border-radius: 3px; }
.img-card.uploading { opacity: 0.55; }
.img-card.uploading::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.05) 8px 16px); animation: img-stripe 1s linear infinite; pointer-events: none; }
@keyframes img-stripe { from { background-position: 0 0 } to { background-position: 22px 0 } }
/* eBay optimisation result dialog (v2.30) */
.ebay-opt-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 16px; }
.ebay-opt-panel { background: var(--bg); color: var(--text); border-radius: var(--radius); max-width: 920px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.ebay-opt-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; z-index: 2; }
.ebay-opt-head h2 { margin: 0; font-size: 16px; }
.ebay-opt-body { padding: 14px 18px; }
.ebay-opt-section { margin-bottom: 18px; }
.ebay-opt-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); }
.ebay-opt-section h3 .badge { font-size: 11px; padding: 2px 7px; border-radius: 9px; background: var(--surface2); color: var(--text2); font-weight: 600; letter-spacing: 0; text-transform: none; }
.ebay-opt-section h3 .badge.ok { background: #e7f5e7; color: #0a5a0a; }
.ebay-opt-section h3 .badge.warn { background: #fde9d4; color: #9a4f00; }
.ebay-opt-section h3 .badge.err { background: #fde0e0; color: #a00; }
.ebay-opt-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 12.5px; line-height: 1.5; }
.ebay-opt-box.mono { font-family: 'DM Mono', monospace; white-space: pre-wrap; word-break: break-word; }
.ebay-opt-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ebay-opt-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ebay-opt-tbl th, .ebay-opt-tbl td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ebay-opt-tbl th { background: var(--surface2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text2); }
.ebay-opt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .ebay-opt-grid2 { grid-template-columns: 1fr } }
.ebay-opt-preview { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; max-height: 420px; overflow: auto; color: #111; }
.ebay-opt-loading { padding: 36px 18px; text-align: center; color: var(--text2); }
.ebay-opt-loading .spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--surface2); border-top-color: var(--blue, #0a6); border-radius: 50%; animation: ebay-opt-spin 0.9s linear infinite; margin-bottom: 12px; }
@keyframes ebay-opt-spin { to { transform: rotate(360deg) } }
@keyframes slideInRight { from { transform: translateX(40px); opacity:0 } to { transform: translateX(0); opacity:1 } }
/* eBay description preview — give block elements visible spacing so the
   user can see paragraphs/sections without inspecting the raw HTML.
   Mirrors what eBay's mobile/desktop listing rendering does. */
#f-ebaydescription-preview h3 { margin: 16px 0 6px; font-size: 14px; color: #F1880D; }
#f-ebaydescription-preview h3:first-child { margin-top: 4px; }
#f-ebaydescription-preview p { margin: 0 0 10px; }
#f-ebaydescription-preview ul, #f-ebaydescription-preview ol { margin: 0 0 10px 0; padding-left: 20px; }
#f-ebaydescription-preview li { margin: 3px 0; }
#f-ebaydescription-preview:focus { box-shadow: inset 0 0 0 2px var(--blue, #6c8fff); }
.calc-ch-tabs { display:flex; gap:0; margin: 4px 0 18px; border-bottom: 1px solid var(--border); }
.calc-ch-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 8px 18px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; font-family: inherit; }
.calc-ch-tab:hover { color: var(--text); }
.calc-ch-tab.active { color: var(--text); border-bottom-color: var(--blue); }
/* (AU fork, 2026-07-21) Lists tab sub-tabs — per-store Shopify collections/
   tags (Chubby AUS vs AUS Wholesale). Same visual language as .calc-ch-tab,
   own class so it isn't accidentally caught by channel-tab JS selectors. */
.lists-store-tabs { display:flex; gap:0; margin: 2px 0 10px; border-bottom: 1px solid var(--border); }
.lists-store-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 6px 14px; font-size: 12.5px; font-weight: 500; color: var(--text2); cursor: pointer; font-family: inherit; }
.lists-store-tab:hover { color: var(--text); }
.lists-store-tab.active { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.lists-store-panel.hidden { display: none; }
.ch-name { font-size: 10px; font-weight: 600; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.ch-price { font-size: 22px; font-weight: 300; font-family: 'DM Mono', monospace; margin-bottom: 4px; letter-spacing: -0.02em; }
.ch-detail { font-size: 11px; color: var(--text2); margin-top: 3px; }
.ch-card.highlight { border-color: #16a34a; }

/* ---- SECTION HEADER ---- */
.sec-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-title { font-size: 13px; font-weight: 500; }

/* ---- TARGET BAR ---- */
.target-bar { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.target-bar label { font-size: 12px; color: var(--text2); white-space: nowrap; }
.target-bar input { width: 60px; }

/* ---- SEARCH ROW ---- */
.search-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-row select { min-width: 130px; }
/* Prominent search input — bigger, bolder border, magnifier icon, accent
   glow on focus. Used on the products screen so the search box is the
   first thing the eye lands on. */
.search-box {
  flex: 2;
  min-width: 240px;
  position: relative;
}
.search-box::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Inline magnifier SVG — colour matches --blue (#1e40af, URL-encoded). */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-4.35-4.35'/></svg>");
  opacity: 0.85;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.10);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.search-box input::placeholder {
  color: var(--text2);
  font-weight: 400;
}
.search-box input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.22);
}

/* ---- FEE SECTIONS ---- */
.fee-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 14px; }
.fee-card h3 { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.fee-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }

/* ---- MISC ---- */
.empty { text-align: center; padding: 40px; color: var(--text3); font-size: 13px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.mono { font-family: 'DM Mono', monospace; }
.text2 { color: var(--text2); }
.section-label { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }

/* ---- CALCULATOR ---- */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.calc-col { min-width: 0; }
.calc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--surface2); border-radius: var(--radius); padding: 10px 12px; }
.kpi-label { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 300; font-family: 'DM Mono', monospace; letter-spacing: -0.02em; }
.kpi-value.good { color: var(--green); }
.kpi-value.warn { color: var(--amber); }
.kpi-value.bad { color: var(--red); }
.cost-section-title { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 6px; padding-top: 8px; border-top: 1px dashed var(--border2); }
.cost-section-title:first-child, .cost-box > .cost-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.cost-row.sub { color: var(--text3); font-size: 11.5px; padding: 2px 0; }
.cost-row.sub:last-child { font-weight: normal; padding-top: 2px; }
.cost-row.emph { font-weight: 600; font-size: 13px; }
.cost-row.bordered-top { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.discount-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.discount-tbl th, .discount-tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.discount-tbl th { font-size: 10px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface2); }
.discount-tbl tr:hover td { background: var(--surface2); }
.discount-tbl td.mono, .discount-tbl th.mono { font-family: 'DM Mono', monospace; }
.calc-pill { display:inline-block; background: var(--blue-bg); color: var(--blue-text); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 500; }
.calc-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.calc-section-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; gap:14px; flex-wrap:wrap; }
.calc-section-bar .section-label { margin-bottom: 0; }
.calc-section-bar .qty-picker { display:flex; align-items:center; gap:8px; }
.calc-section-bar .qty-picker label { font-size: 11.5px; color: var(--text2); }
.calc-section-bar .qty-picker select { width: auto; min-width: 90px; font-size: 12px; padding: 4px 8px; }
.mini-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-tbl th, .mini-tbl td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mini-tbl th:first-child, .mini-tbl td:first-child { text-align: left; }
.mini-tbl th { font-size: 9.5px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; background: transparent; }
.mini-tbl tbody tr:last-child td { border-bottom: none; }
.mini-tbl tr.qty-free td { background: var(--green-bg); }
.mini-tbl tr.qty-free td:first-child { font-weight: 600; }
.discount-tbl tr.d-row { cursor: pointer; }
.discount-tbl tr.d-row:hover td { background: var(--surface2); }
.discount-tbl tr.d-detail td { background: var(--bg); padding: 0; }
.discount-tbl tr.d-detail .d-detail-inner { padding: 8px 14px 12px 36px; }
.d-chevron { display: inline-block; width: 14px; text-align: center; color: var(--text3); transition: transform 0.15s; user-select: none; }
.d-chevron.open { transform: rotate(90deg); color: var(--text); }

/* ---- COURIER CARDS (Shipping tab) ---- */
.courier-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; }
.courier-card h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.courier-card .courier-tagline { font-size: 11.5px; color: var(--text2); margin-bottom: 10px; }
.courier-card ul.rules { margin: 0 0 12px 18px; font-size: 11.5px; color: var(--text2); padding: 0; }
.courier-card ul.rules li { margin-bottom: 3px; }
.courier-rates { display: grid; gap: 8px; }
.rate-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.rate-line label { font-size: 12px; color: var(--text); flex: 1; }
.rate-line .rate-input { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.rate-line .rate-input span { font-size: 12px; color: var(--text2); min-width: 12px; text-align: right; }
.rate-line input { width: 80px; text-align: right; font-family: 'DM Mono', monospace; font-size: 12px; padding: 4px 8px; }
.formula-box { margin-top: 10px; padding: 10px 12px; background: var(--surface2); border-radius: var(--radius); font-size: 11.5px; color: var(--text2); }
.formula-box code { font-family: 'DM Mono', monospace; color: var(--text); background: rgba(0,0,0,0.04); padding: 1px 5px; border-radius: 3px; }
.formula-result { margin-top: 6px; font-family: 'DM Mono', monospace; color: var(--text); }
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .fee-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .sidebar { width: 48px; min-width: 48px; }
  .sidebar-logo, .nav-section, .nav-item span, .sidebar-footer { display: none; }
  .nav-item { padding: 12px; justify-content: center; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .channel-grid { grid-template-columns: 1fr 1fr; }
}
