/* ── Import Tracker – Admin UI ───────────────────────────────────────────── */
/* Self-hosted fonts (latin subset, from Google Fonts) — no render-blocking external @import */
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 300 600; font-display: swap;
  src: url('../fonts/dm-sans-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/dm-mono-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/dm-mono-latin-500.woff2') format('woff2');
}

:root {
  --bg:        #f0f2f5;
  --surface:   #ffffff;
  --surface2:  #f7f8fa;
  --border:    #e4e7ec;
  --primary:   #2563eb;
  --primary-h: #1d4ed8;
  --primary-l: #eff4ff;
  --danger:    #dc2626;
  --danger-l:  #fef2f2;
  --success:   #16a34a;
  --success-l: #f0fdf4;
  --warning:   #d97706;
  --warning-l: #fffbeb;
  --text:      #111827;
  --text-2:    #6b7280;
  --text-3:    #9ca3af;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --font:      'DM Sans', sans-serif;
  --mono:      'DM Mono', monospace;
  --nav-w:     220px;
  --header-h:  60px;

  /* ── Font size scale (Normal = default) ─────────────── */
  --fs-base: 14px;
  --fs-btn:  13.5px;
  --fs-sm:   12.5px;
  --fs-xs:   12px;
  --fs-xxs:  11.5px;
  --fs-nano: 11px;
  --fs-lg:   15px;
  --fs-stat: 26px;
}

/* Font size scaling handled via JS (applyFontSize sets CSS vars on documentElement) */

/* Reset inside plugin */
#import-tracker-app * { box-sizing: border-box; margin: 0; }
/* padding is NOT reset globally — component rules set their own padding */
#import-tracker-app {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  min-height: calc(100vh - 32px);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.it-layout { display: flex; align-items: flex-start; min-height: calc(100vh - 32px); }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.it-sidebar {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 32px;
  height: calc(100vh - 32px);
  overflow-y: auto;
}
.it-sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}
.it-sidebar-logo .logo-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
  flex-shrink: 0;
}
.it-sidebar-logo .logo-text {
  font-weight: 600; font-size: var(--fs-base); color: var(--text); letter-spacing: -.2px;
}
.it-nav { padding: 16px 12px; flex: 1; }
.it-nav-section { margin-bottom: 28px; }
.it-nav-label {
  font-size: var(--fs-nano);
  font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .9px;
  padding: 0 12px; margin-bottom: 6px;
}
.it-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all .15s;
  user-select: none;
  margin-bottom: 2px;
}
.it-nav-item:hover  { background: var(--surface2); color: var(--text); }
.it-nav-item.active { background: var(--primary-l); color: var(--primary); }
.it-nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.it-sidebar-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-nano);
  color: var(--text-3);
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.it-sidebar-logout { color: var(--text-2); text-decoration: none; font-size: var(--fs-xs); }
.it-sidebar-logout:hover { color: var(--danger); }
/* Multi-account: which account is open */
.it-sidebar-account { padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.it-sidebar-account-name { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-sidebar-account a { font-size: var(--fs-xs); color: var(--primary); text-decoration: none; }
a.it-dropup-item { color: inherit; text-decoration: none; }

/* ── Main content ────────────────────────────────────────────────────────── */
.it-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 32px);
  overflow-x: hidden;
}
.it-topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 14px;
  position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
}
.it-topbar-title { font-weight: 600; font-size: var(--fs-lg); flex: 1; }
.it-content { padding: 28px 32px; flex: 1; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.it-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.it-card-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.it-card-header h2 { font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.it-card-body { padding: 26px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.it-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font); font-size: var(--fs-btn); font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; text-decoration: none; line-height: 1.4;
  
}
.it-btn-primary   { background: var(--primary);  color: #fff; border-color: var(--primary); }
.it-btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.it-btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.it-btn-secondary:hover { background: var(--surface2); }
.it-btn-danger    { background: var(--danger-l); color: var(--danger); border-color: #fecaca; }
.it-btn-danger:hover { background: #fee2e2; }
.it-btn-ghost     { background: transparent; color: var(--text-2); border-color: transparent; padding: 7px 12px; }
.it-btn-ghost:hover { background: var(--surface2); color: var(--text); }
.it-btn-sm { padding: 6px 13px; font-size: var(--fs-xs); }
.it-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.it-form-row { display: grid; gap: 20px; margin-bottom: 22px; }
.it-form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.it-form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.it-form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.it-field { display: flex; flex-direction: column; gap: 8px; }
.it-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); letter-spacing: .1px; }
.it-label span.req { color: var(--danger); margin-left: 2px; }
.it-input, .it-select, .it-textarea {
  font-family: var(--font); font-size: var(--fs-btn);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
  transition: border .15s, box-shadow .15s;
  width: 100%;
  outline: none;
}
.it-input:focus, .it-select:focus, .it-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.it-input.mono { font-family: var(--mono); }
.it-textarea { resize: vertical; min-height: 76px; }
.it-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 36px; cursor: pointer;
}

/* ── Input group (prefix addon on LEFT, input on RIGHT) ──────────────────── */
.it-input-group { display: flex; }
.it-input-group .it-input-addon {
  /* LEFT element — rounded left corners, flat right edge */
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-2);
  display: flex; align-items: center; 
  flex-shrink: 0;
}
.it-input-group .it-input {
  /* RIGHT element — flat left corners, rounded right edge */
  border-radius: 0 var(--radius) var(--radius) 0;
}

.it-hint { font-size: var(--fs-xxs); color: var(--text-3); margin-top: 3px; }

/* ── Radio group ─────────────────────────────────────────────────────────── */
.it-radio-group { display: flex; gap: 10px; }
.it-radio-btn {
  flex: 1; text-align: center;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; font-size: var(--fs-sm); font-weight: 500;
  color: var(--text-2); background: var(--surface);
  transition: all .15s; user-select: none;
  line-height: 1.4;
}
.it-radio-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.it-radio-btn.selected { background: var(--primary-l); border-color: var(--primary); color: var(--primary); }
.it-radio-btn.it-radio-btn-sm { padding: 7px 14px; font-size: var(--fs-xs); flex: none; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.it-table-wrap { 
  overflow-x: auto;
  overflow-y: visible;
  max-height: calc(100vh - 280px); /* Allow vertical scroll within viewport */
}
.it-table { width: 100%; border-collapse: collapse; font-size: var(--fs-btn); }
.it-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2);
  padding: 14px 20px;
  font-weight: 600; font-size: var(--fs-xs);
  color: var(--text-2);
  text-align: left;
  border-bottom: 1px solid var(--border);
  
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}
.it-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.5;
}
/* Extra breathing room on outermost columns */
.it-table th:first-child, .it-table td:first-child { padding-left: 32px; }
.it-table th:last-child,  .it-table td:last-child  { padding-right: 32px; }
.it-table tr:last-child td { border-bottom: none; }
.it-table tr:hover td { background: var(--surface2); }
.it-table .mono { font-family: var(--mono); font-size: var(--fs-xs); }
.it-table .actions { display: flex; gap: 6px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.it-badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px;
  font-size: var(--fs-xxs); font-weight: 500;
  line-height: 1.3;
}
.it-badge-blue   { background: var(--primary-l); color: var(--primary); }
.it-badge-green  { background: var(--success-l); color: var(--success); }
.it-badge-teal   { background: #e0f7f4; color: #0e7b6e; }
.it-badge-orange { background: var(--warning-l); color: var(--warning); }
.it-badge-gray   { background: var(--surface2);  color: var(--text-2); }
.it-badge-red    { background: var(--danger-l);  color: var(--danger); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.it-modal-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 48px;
  animation: it-fade-in .15s ease;
}
.it-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 680px; max-width: 96vw;
  max-height: 90vh; overflow-y: auto;
  animation: it-slide-up .2s ease;
}
.it-modal.wide { width: 900px; }
.it-modal-header {
  padding: 22px 30px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; background: var(--surface); z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.it-modal-header h3 { font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.it-modal-body { padding: 30px; }
.it-modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Measure Item(s) rows ────────────────────────────────────────────────── */
.it-measure-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.it-measure-item:last-child { margin-bottom: 0; }
.it-measure-item-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 10px;
}
.it-measure-item-desc {
  font-size: var(--fs-sm); font-weight: 500; color: var(--text); min-width: 0;
}
.it-measure-item-qty {
  font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; flex-shrink: 0;
}
.it-measure-item-fields {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.it-measure-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.it-measure-field-label { font-size: var(--fs-xxs); font-weight: 600; color: var(--text-2); }
.it-measure-field .it-input { padding: 8px 12px; font-size: 15px; }

/* ── SKU Line Items ──────────────────────────────────────────────────────── */
.it-sku-list { display: flex; flex-direction: column; gap: 10px; }
.it-sku-row {
  display: grid;
  grid-template-columns: 1fr 90px 130px 36px;
  gap: 10px;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.it-sku-add-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer; font-size: var(--fs-sm); color: var(--text-2);
  background: transparent;
  font-family: var(--font);
  transition: all .15s;
  width: 100%;
  justify-content: center;
}
.it-sku-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }

/* ── Stats / Summary ─────────────────────────────────────────────────────── */
.it-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.it-stats-3 { grid-template-columns: repeat(3, 1fr); }
.it-stats-4 { grid-template-columns: repeat(4, 1fr); }
.it-stats-5 { grid-template-columns: repeat(5, 1fr); }
.it-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}
.it-stat-label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.it-stat-value { font-size: var(--fs-stat); font-weight: 600; color: var(--text); line-height: 1.1; }
.it-stat-sub   { font-size: var(--fs-xxs); color: var(--text-3); margin-top: 5px; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.it-filters {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 4px 0;
}
.it-filters .it-input, .it-filters .it-select { width: auto; min-width: 140px; height: 40px; }
.it-filters .spacer { flex: 1; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.it-empty { text-align: center; padding: 60px 24px; color: var(--text-2); }
.it-empty .icon { font-size: 42px; margin-bottom: 14px; opacity: .4; }
.it-empty h3 { font-size: var(--fs-lg); font-weight: 600; color: var(--text); margin-bottom: 8px; }
.it-empty p  { font-size: var(--fs-btn); }

/* ── General Settings ────────────────────────────────────────────────────── */
.it-settings-section { margin-bottom: 36px; }
.it-settings-section-title {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.it-font-size-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.it-font-size-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  cursor: pointer; text-align: center;
  transition: all .15s; background: var(--surface);
  user-select: none;
}
.it-font-size-option:hover { border-color: var(--primary); background: var(--primary-l); }
.it-font-size-option.selected { border-color: var(--primary); background: var(--primary-l); }
.it-font-size-option .it-fso-label  { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.it-font-size-option .it-fso-preview { color: var(--text-2); }
.it-font-size-option.selected .it-fso-label,
.it-font-size-option.selected .it-fso-preview { color: var(--primary); }
.it-font-size-option .it-fso-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; margin-top: 10px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes it-fade-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes it-slide-up { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ── Util ────────────────────────────────────────────────────────────────── */
.it-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.it-section-label {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px;
}
.text-right  { text-align: right; }
.text-center { text-align: center; }
.it-loading { display: flex; align-items: center; justify-content: center; padding: 52px; color: var(--text-2); gap: 12px; }
.it-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* Hide WP admin stuff that bleeds in */
#import-tracker-app .wp-header-end { display: none; }

/* ── Responsive / Mobile ─────────────────────────────────────────────────── */

/* Tablet — stats go 2×2 */
@media (max-width: 900px) {
  .it-stats { grid-template-columns: repeat(2, 1fr); }
  .it-stats-3, .it-stats-4, .it-stats-5 { grid-template-columns: repeat(2, 1fr); }
}

/* Narrow tablet / large phone — collapse multi-col form rows */
@media (max-width: 768px) {

  /* Form rows always stack */
  .it-form-row.cols-2,
  .it-form-row.cols-3,
  .it-form-row.cols-4 { grid-template-columns: 1fr; }

  /* Modal: full-width, flat bottom, max-height */
  .it-modal-overlay { padding-top: 0; align-items: flex-end; }
  .it-modal, .it-modal.wide {
    width: 100%; max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
  }
  .it-modal-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .it-modal-footer { border-radius: 0; }

  /* SKU row: description takes full width, qty + price sit below */
  .it-sku-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .it-sku-row > .it-field:first-child { grid-column: 1 / -1; }

  /* Font size grid: 2 columns */
  .it-font-size-grid { grid-template-columns: repeat(2, 1fr); }

  /* Filters: reduce min-width so they wrap more readily */
  .it-filters .it-input,
  .it-filters .it-select { min-width: 110px; }

  /* Topbar: tighter padding */
  .it-topbar { padding: 0 18px; }
  .it-content { padding: 26px; }
}

/* Phone — single stat column, further tightening */
@media (max-width: 480px) {
  .it-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .it-stats-3, .it-stats-4, .it-stats-5 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .it-modal-body { padding: 20px; }
  .it-modal-header { padding: 18px 20px; }
  .it-modal-footer { padding: 14px 20px; }

  /* Radio group: stack vertically on very small screens */
  .it-radio-group { flex-direction: column; }
  .it-radio-btn { text-align: left; }

  /* Measure Item(s): L/W/H fields stack full-width on phones */
  .it-measure-item-fields { grid-template-columns: 1fr; }

  /* Courier/declared/notes: hint text below input doesn't need column width */
  .it-hint { white-space: normal; }

  /* Table: allow horizontal scroll, reduce outer column padding */
  .it-table th:first-child, .it-table td:first-child { padding-left: 14px; }
  .it-table th:last-child,  .it-table td:last-child  { padding-right: 14px; }
}

/* ── Mobile Bottom Navigation ────────────────────────────────────────────── */
.it-bottom-nav { display: none; }   /* hidden on desktop */

@media (max-width: 768px) {
  /* Hide sidebar, show bottom nav */
  .it-sidebar { display: none; }
  .it-main { padding-bottom: 64px; }   /* room for bottom bar */

  .it-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--surface);
    border-top: 1.5px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 200;
    /* Safe area for iPhone home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .it-bni {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    color: var(--text-3);
    transition: color .15s;
    user-select: none;
    padding: 8px 4px;
    position: relative;
  }
  .it-bni:active { background: var(--surface2); }
  .it-bni.active { color: var(--primary); }

  /* Active indicator dot above icon */
  .it-bni.active::before {
    content: '';
    position: absolute;
    top: 5px;
    width: 20px; height: 3px;
    background: var(--primary);
    border-radius: 99px;
  }

  .it-bni-icon  { font-size: 20px; line-height: 1; }
  .it-bni-label { font-size: 10px; font-weight: 600; letter-spacing: .2px; }

  /* Drop-up backdrop */
  .it-dropup-overlay {
    position: fixed;
    inset: 0;
    bottom: 60px;
    background: rgba(0,0,0,.35);
    z-index: 210;
    animation: it-fade-in .15s ease;
  }

  /* Drop-up sheet */
  .it-dropup {
    position: fixed;
    bottom: 60px;
    left: 0; right: 0;
    z-index: 220;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0,0,0,.12);
    padding: 6px 0 8px;
    animation: it-slide-up .2s ease;
  }

  /* Drag handle visual cue */
  .it-dropup::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 99px;
    margin: 8px auto 10px;
  }

  .it-dropup-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .9px;
    padding: 4px 22px 8px;
  }

  .it-dropup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: background .1s;
    min-height: 52px;   /* comfortable touch target */
  }
  .it-dropup-item:active { background: var(--surface2); }
  .it-dropup-item.active {
    color: var(--primary);
    background: var(--primary-l);
    font-weight: 600;
  }
  .it-dropup-item span { font-size: 18px; }
}

/* ── Bottom Navigation & Drop-up (mobile only) ───────────────────────────── */

/* Hidden on desktop */
.it-bottom-nav     { display: none; }
.it-dropup-overlay { display: none; }
.it-dropup         { display: none; }

@media (max-width: 768px) {

  /* Hide desktop sidebar */
  .it-sidebar { display: none; }

  /* Push content above the bottom nav */
  .it-main { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

  /* ── Bottom nav bar ────────────────────────────────────────────────── */
  .it-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 300;
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  }

  .it-bni {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    color: var(--text-3);
    font-size: var(--fs-nano);
    font-weight: 500;
    padding: 8px 4px 6px;
    position: relative;
    transition: color .15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .it-bni:active { background: var(--surface2); }

  .it-bni-icon  { font-size: 20px; line-height: 1; }
  .it-bni-label { font-size: 10px; font-weight: 500; letter-spacing: .2px; }

  /* Active state — primary colour + top bar */
  .it-bni.active {
    color: var(--primary);
  }
  .it-bni.active::before {
    content: '';
    position: absolute;
    top: 0; left: 25%; right: 25%;
    height: 2.5px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }

  /* Open state (drop-up is showing for this tab) */
  .it-bni.active.open-dropup::before { background: var(--primary); }
  .it-bni.open-dropup { color: var(--primary); }

  /* ── Drop-up overlay (dark scrim) ──────────────────────────────────── */
  .it-dropup-overlay {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    background: rgba(0,0,0,.3);
    z-index: 298;
    animation: it-fade-in .15s ease;
  }

  /* ── Drop-up panel ─────────────────────────────────────────────────── */
  .it-dropup {
    display: block;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
    z-index: 299;
    padding: 10px 0 6px;
    animation: it-slide-up .22s cubic-bezier(.32,1,.64,1);
  }

  /* Drag handle */
  .it-dropup::before {
    content: '';
    display: block;
    width: 38px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 14px;
  }

  /* Section heading inside dropup */
  .it-dropup-label {
    font-size: var(--fs-nano);
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 0 22px 8px;
  }

  /* Drop-up items */
  .it-dropup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: background .1s, color .1s;
    -webkit-tap-highlight-color: transparent;
  }
  .it-dropup-item:active       { background: var(--surface2); }
  .it-dropup-item.active       { color: var(--primary); background: var(--primary-l); }
  .it-dropup-item span:first-child { font-size: 18px; width: 24px; text-align: center; }
}

/* ── Bulk Import ─────────────────────────────────────────────────────────── */
.it-modal-bulk { width: 860px; }

/* Drop zone */
.it-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface2);
}
.it-dropzone:hover, .it-dropzone.dragging {
  border-color: var(--primary);
  background: var(--primary-l);
}
.it-dropzone-icon  { font-size: 36px; margin-bottom: 10px; }
.it-dropzone-main  { font-size: var(--fs-base); font-weight: 600; color: var(--text); margin-bottom: 4px; }
.it-dropzone-sub   { font-size: var(--fs-xs); color: var(--text-3); }

.it-bulk-template-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 18px;
}

/* Column format info */
.it-bulk-format-info {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.it-bulk-format-title {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}
.it-bulk-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.it-bulk-col {
  font-size: var(--fs-xxs);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 8px; color: var(--text-2);
}
.it-bulk-col.required { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.it-bulk-col strong { margin-right: 3px; }
.it-bulk-col .req { color: var(--danger); margin-left: 1px; }

/* Preview header */
.it-bulk-file-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.it-bulk-filename { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); flex: 1; }

/* Preview table height cap */
.it-bulk-preview-table { max-height: 360px; overflow-y: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* Row status colours */
.it-row-error td { background: #fff5f5 !important; }
.it-row-warn  td { background: #fffbeb !important; }

/* Error list */
.it-bulk-error-list {
  margin-top: 12px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: var(--danger-l);
  padding: 12px 16px;
  max-height: 120px;
  overflow-y: auto;
}
.it-bulk-error-item {
  font-size: var(--fs-xs); color: var(--danger);
  padding: 4px 0; border-bottom: 1px solid #fecaca;
}
.it-bulk-error-item:last-child { border-bottom: none; }

/* Importing progress */
.it-bulk-importing {
  text-align: center; padding: 32px 0;
  font-size: var(--fs-base); color: var(--text-2);
}
.it-bulk-spinner { width: 28px; height: 28px; margin: 0 auto 16px; }
.it-bulk-bar-wrap {
  height: 6px; background: var(--border);
  border-radius: 99px; margin-top: 14px; overflow: hidden;
}
.it-bulk-bar-fill {
  height: 100%; background: var(--primary);
  border-radius: 99px; transition: width .3s ease;
}

/* Done state */
.it-bulk-done { text-align: center; padding: 32px 0; }
.it-bulk-done-icon { font-size: 42px; margin-bottom: 12px; }
.it-bulk-done h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: 8px; }
.it-bulk-done p  { font-size: var(--fs-base); color: var(--text-2); margin-bottom: 4px; }

/* ── Bulk Selection ──────────────────────────────────────────────────────── */
.it-col-check {
  width: 44px;
  padding-left: 16px !important;
  padding-right: 8px !important;
}
.it-checkbox {
  width: 16px; height: 16px;
  cursor: pointer; accent-color: var(--primary);
  flex-shrink: 0;
}
/* Selected row highlight */
.it-table tr.selected td { background: var(--primary-l) !important; }

/* ── Inline field validation ─────────────────────────────────────────────── */
.it-input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1) !important;
}
.it-field-error {
  font-size: var(--fs-xxs);
  color: var(--danger);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.it-field-error::before { content: '⚠'; }

/* ── Orders-per-page selector ────────────────────────────────────────────── */
.it-per-page-grid {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.it-per-page-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  min-width: 90px;
  cursor: pointer; text-align: center;
  transition: all .15s; background: var(--surface);
  user-select: none;
}
.it-per-page-option:hover { border-color: var(--primary); background: var(--primary-l); }
.it-per-page-option.selected { border-color: var(--primary); background: var(--primary-l); }
.it-per-page-option.saving  { opacity: .6; pointer-events: none; }
.it-per-page-num { font-size: var(--fs-stat); font-weight: 700; color: var(--text); line-height: 1.1; }
.it-per-page-sub { font-size: var(--fs-xxs); color: var(--text-3); margin-top: 4px; }
.it-per-page-option.selected .it-per-page-num,
.it-per-page-option.selected .it-per-page-sub { color: var(--primary); }

/* ── CN Warehouse ────────────────────────────────────────────────────────── */
.it-wh-items { display: flex; flex-direction: column; gap: 2px; }
.it-wh-item-row { font-size: var(--fs-xs); }

/* Items and Declared CNH cells with copy buttons */
.it-wh-items-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 250px; /* Make Items column wider */
}
.it-wh-declared-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.it-copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}
.it-copy-btn:hover {
  background: var(--primary-l);
  border-color: var(--primary);
  color: var(--primary);
}

.it-wh-order-row { display: flex; gap: 10px; align-items: center; }

/* Order preview panel */
.it-wh-order-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.it-wh-preview-row  { display: flex; gap: 16px; align-items: flex-start; }
.it-wh-preview-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); min-width: 110px; flex-shrink: 0; padding-top: 1px; }
.it-wh-preview-val   { font-size: var(--fs-xs); color: var(--text); line-height: 1.6; }

/* Calculated freight cost row */
.it-wh-calc-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-top: 4px;
}
.it-wh-calc-row.it-wh-calc-error { background: var(--danger-l); border-color: #fecaca; }
.it-wh-calc-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.it-wh-calc-val   { font-size: var(--fs-base); flex: 1; }
.it-wh-calc-val strong { color: var(--success); font-size: var(--fs-lg); }
.it-cbm-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid transparent;
}
.it-cbm-ok      { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.it-cbm-mismatch{ background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.it-order-costs-row td { padding: 0 !important; background: var(--bg); }
.it-unit-costs { padding: 12px 20px; border-top: 2px solid var(--primary-l); }
.it-unit-costs-title { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.it-unit-costs-grid { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 8px; }
.it-unit-cost-item { display: flex; flex-direction: column; gap: 2px; }
.it-unit-cost-label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }
.it-unit-cost-value { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.it-unit-cost-na { color: var(--text-3); font-weight: 400; }
.it-unit-cost-pending { color: var(--text-2); font-weight: 400; font-size: var(--fs-xs); }
.it-unit-cost-tag { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-size: var(--fs-xxs); color: var(--text-3); margin-left: 4px; vertical-align: middle; }
.it-unit-costs-note { font-size: var(--fs-xxs); color: var(--text-3); margin-top: 4px; }

/* FIFO Allocation Breakdown */
.it-fifo-breakdown { 
  margin-top: 20px; 
  padding-top: 16px; 
  border-top: 1px solid var(--border); 
}
.it-fifo-breakdown-title { 
  font-size: var(--fs-xs); 
  font-weight: 700; 
  color: var(--primary); 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
  margin-bottom: 10px; 
  display: flex;
  align-items: center;
}
.it-fifo-breakdown-grid { 
  display: flex; 
  gap: 24px; 
  flex-wrap: wrap; 
  margin-bottom: 8px; 
  background: var(--success-l); 
  padding: 12px 16px; 
  border-radius: var(--radius); 
  border: 1px solid var(--success); 
}
.it-fifo-breakdown-item { 
  display: flex; 
  gap: 8px; 
  align-items: baseline; 
}
.it-fifo-breakdown-label { 
  font-size: var(--fs-xs); 
  color: var(--text-2); 
  font-weight: 500; 
}
.it-fifo-breakdown-value { 
  font-size: var(--fs-sm); 
  font-weight: 700; 
  color: var(--success); 
}
.it-fifo-breakdown-total {
  margin-left: auto;
}
.it-fifo-breakdown-total .it-fifo-breakdown-value {
  font-size: var(--fs-base);
}
.it-fifo-breakdown-note { 
  font-size: var(--fs-xxs); 
  color: var(--text-2); 
  margin-top: 6px; 
  font-weight: 500;
}

.it-locked-fields { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.it-locked-row { display: flex; align-items: center; padding: 8px 14px; gap: 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.it-locked-row:last-child { border-bottom: none; }
.it-locked-calc { background: var(--bg); }
.it-locked-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); min-width: 160px; }
.it-locked-value { font-size: var(--fs-sm); color: var(--text-1); display: flex; align-items: center; gap: 8px; flex: 1; }
.it-locked-input { max-width: 200px; }
.it-pencil { background: none; border: none; cursor: pointer; font-size: 13px; padding: 2px 4px; opacity: 0.5; line-height: 1; }
.it-pencil:hover { opacity: 1; }
.it-sgd-breakdown { display: flex; flex-direction: column; gap: 3px; background: var(--bg); border-radius: 6px; padding: 8px 12px; border: 1px solid var(--border); font-size: var(--fs-xs); }
.it-sgd-row { display: flex; justify-content: space-between; color: var(--text-2); }
.it-sgd-row-total { color: var(--text-1); font-weight: 600; border-top: 1px solid var(--border); margin-top: 3px; padding-top: 3px; }
.it-wf-unmatched td { background: #fffbeb !important; }

/* Clickable stat cards (WorldFirst status filters) */
.it-stat-clickable { cursor: pointer; transition: background .12s, box-shadow .12s; }
.it-stat-clickable:hover { background: var(--bg-2, #e8f0fe); }
.it-stat-clickable.active { box-shadow: inset 0 0 0 2px var(--primary, #1a73e8); }
/* Pagination */
.it-pagination { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.it-pagination-info { font-size: var(--fs-xs); color: var(--text-2); flex: 1; }
.it-pagination .it-btn { min-width: 80px; }
@media (max-width: 480px) { .it-pagination { gap: 6px; } .it-pagination .it-btn { min-width: 64px; font-size: var(--fs-xs); } }
/* Sub-tabs */
.it-sub-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); padding: 0 32px; background: var(--surface); }
.it-sub-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 12px 20px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); cursor: pointer; transition: color .15s, border-color .15s; }
.it-sub-tab:hover { color: var(--text-1); }
.it-sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
/* FIFO ledger rows */
.it-fifo-addition td { background: #f0fdf4; }
.it-fifo-deduction td { background: var(--surface); }
@media (max-width: 768px) { .it-sub-tabs { padding: 0 18px; } .it-sub-tab { padding: 10px 14px; } }

/* Consolidation error message */
.it-wh-error-msg {
  margin-top: 14px; padding: 12px 14px;
  background: var(--danger-l); border: 1px solid #fecaca;
  border-radius: var(--radius); color: var(--danger);
  font-size: var(--fs-xs);
}

/* ── Custom Order Picker (CN Warehouse) ──────────────────────────────────── */
.it-wh-custom-select {
  position: relative;
}
.it-wh-custom-select .it-input {
  padding-right: 36px; /* room for clear button */
}
.it-wh-cs-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 13px; padding: 2px 4px;
  line-height: 1;
}
.it-wh-cs-clear:hover { color: var(--text); }

/* Dropdown panel */
.it-wh-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 300;
  max-height: 280px; overflow-y: auto;
}
.it-wh-dropdown-empty {
  padding: 14px 16px;
  font-size: var(--fs-xs); color: var(--text-3); text-align: center;
}

/* Individual option row */
.it-wh-option {
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.it-wh-option:last-child { border-bottom: none; }
.it-wh-option:hover:not(.grayed) { background: var(--primary-l); }
.it-wh-option.active { background: var(--primary-l); }
.it-wh-option.grayed {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}
.it-wh-option-id {
  font-family: var(--mono); font-size: var(--fs-xs);
  font-weight: 600; color: var(--text);
  margin-bottom: 3px;
}
.it-wh-option.active .it-wh-option-id  { color: var(--primary); }
.it-wh-option-summary {
  font-size: var(--fs-xxs); color: var(--text-2); line-height: 1.5;
}

/* ── Shipments Page ──────────────────────────────────────────────────────── */
.it-shipment-row { cursor: pointer; }
.it-shipment-row:hover td { background: var(--surface2); }
.it-shipment-expanded td { background: var(--primary-l) !important; }

.it-shipment-parcels-row td { padding: 0 !important; border-bottom: 2px solid var(--primary); }
.it-shipment-parcels {
  background: var(--surface2);
  padding: 16px 26px 20px;
}
.it-sp-header {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 12px;
}
/* Inner parcel table — inherits .it-table but slightly more compact */
.it-sp-table th,
.it-sp-table td { padding: 10px 14px !important; }
.it-sp-table th:first-child,
.it-sp-table td:first-child { padding-left: 18px !important; }
.it-sp-table th:last-child,
.it-sp-table td:last-child  { padding-right: 18px !important; }

/* ── Edit Shipment Modal ─────────────────────────────────────────────────── */
.it-modal-edit-shipment { width: 1000px; }

/* Compact dimension inputs inside the parcel table */
.it-dim-input {
  width: 90px !important;
  padding: 6px 8px !important;
  font-size: var(--fs-xs) !important;
  text-align: right;
}


/* ── v1.5.0 scroll mirror ─────────────────────────────────────────────────── */
.it-scroll-mirror-wrap { overflow: hidden; }
.it-scroll-mirror { overflow-x: auto; overflow-y: hidden; height: 16px; }
.it-scroll-mirror > div { height: 1px; }

/* ── v1.5.0 expand column ─────────────────────────────────────────────────── */
.it-col-expand { width: 32px; text-align: center; padding: 0; }
.it-expand-btn { background: none; border: none; cursor: pointer; color: var(--text-2); font-size: 11px; padding: 4px 6px; border-radius: 4px; line-height: 1; }
.it-expand-btn:hover { background: var(--bg-2); color: var(--text-1); }

/* ── v1.5.0 column picker toolbar ─────────────────────────────────────────── */
.it-table-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 0; position: relative; }
.it-col-picker-wrap { position: absolute; top: 100%; left: 0; z-index: 100; }
.it-col-picker { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.15); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 280px; }
.it-col-picker-item { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); cursor: pointer; }
.it-col-picker-item input { cursor: pointer; }

/* ── v1.5.0 total unit cost row ───────────────────────────────────────────── */
.it-unit-cost-total-row { display: flex; gap: 24px; padding: 8px 12px; background: var(--bg-2); border-radius: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.it-unit-cost-total-item, .it-unit-cost-qty-item { display: flex; align-items: center; gap: 8px; }
.it-unit-cost-total-val { font-weight: 600; color: var(--text-1); font-size: var(--fs-sm); display: flex; align-items: center; gap: 4px; }

/* ── v1.5.0 copy button ───────────────────────────────────────────────────── */
.it-copy-btn { background: none; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; color: var(--text-3); font-size: 11px; padding: 1px 4px; line-height: 1; }
.it-copy-btn:hover { color: var(--text-1); background: var(--bg-2); }

/* ── CN Warehouse duplicate button ─────────────────────────────────────────── */
.it-dup-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-2);
  padding: 3px 7px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
  
}
.it-dup-btn:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--text-3); }
.it-dup-icon { font-size: 13px; }
.it-dup-label { font-size: 9px; letter-spacing: .3px; text-transform: uppercase; color: var(--text-3); }
.it-dup-btn:hover .it-dup-label { color: var(--text-2); }

/* ── Field-level locked display (parcel modal) ─────────────────────────────── */
.it-field-locked { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; min-height: 34px; }
.it-field-locked-val { flex: 1; font-size: var(--fs-sm); color: var(--text-2); }

/* ── Order search: items-match tag ─────────────────────────────────────────── */
.it-wh-match-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; font-size: 10px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; background: var(--bg-2); color: var(--text-3); border-radius: 3px; vertical-align: middle; }
.it-wh-option.items-match .it-wh-option-id { color: var(--text-1); }

/* ── Inventory Page ─────────────────────────────────────────────────────────── */
.it-inv-ref-row { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ── Toggle switch ──────────────────────────────────────────────────────────── */
.it-toggle-track { width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; transition: background .2s; flex-shrink: 0; }
.it-toggle-track.on { background: var(--accent); }
.it-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
.it-toggle-track.on .it-toggle-thumb { left: 23px; }
.it-inv-dup-row td { background: #fef2f2; color: #b91c1c; }
.it-btn-success { background:#dcfce7; color:#16a34a; border-color:#bbf7d0; } .it-btn-success:hover { background:#bbf7d0; }

/* Thicker, easier-to-grab top scroll mirror scrollbar */
.it-scroll-mirror::-webkit-scrollbar { height: 12px; }
.it-scroll-mirror::-webkit-scrollbar-track { background: var(--surface2, #f1f5f9); border-radius: 6px; }
.it-scroll-mirror::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 6px; border: 2px solid var(--surface2, #f1f5f9); }
.it-scroll-mirror::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* --- User search (Specific Users in Settings) --- */
.it-user-search-item:hover { background: var(--bg-2); }

/* --- Receiving Shipment page --- */
.it-info-row {
  display:flex;justify-content:space-between;padding:6px 0;
  border-bottom:1px solid var(--border);font-size:var(--fs-sm);
}
.it-info-row label { font-weight:600; color:var(--text-2); min-width:140px; }
.it-info-row span { text-align:right; color:var(--text-1); }

/* --- Receiving Shipment page mobile layout --- */
.receiving-page {
  padding: 0 24px;
}

.rv-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.rv-search-row .it-input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) {
  .rv-search-row {
    flex-direction: column-reverse;
  }
  .rv-scan-btn {
    width: 100%;
    font-size: 1.5em;
    padding: 16px 24px;
    height: auto;
  }
}

/* --- Receiving Shipment: compact mobile rows (both tables) ---
   Each parcel becomes a 4-line grid row so at least 4 parcels fit on a phone screen:
   [chk] Tracking No            Receive pill
   [chk] Order No               Dim Status
   [chk] Items (one line)
   [chk] Dimensions / CBM       Receive / Measure */
.rv-ship-wrap { max-height: 420px; }
@media (max-width: 768px) {
  .receiving-page { padding: 0; }
  .receiving-page .it-card-body { padding: 12px; }
  .rv-ship-wrap { max-height: 70vh; overflow-x: hidden; }
  .rv-table, .rv-table tbody { display: block; }
  .rv-table thead { display: none; }
  .rv-table tr {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
      "chk track recv"
      "chk order dimst"
      "chk items items"
      "chk size  act";
    column-gap: 8px; row-gap: 2px; align-items: center;
    padding: 8px 10px; margin-bottom: 6px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
  }
  .rv-table tr:hover td { background: transparent; }
  .rv-table td,
  .rv-table td:first-child,
  .rv-table td:last-child {
    display: block; padding: 0; border: none; min-width: 0;
    font-size: var(--fs-xs); line-height: 1.35;
  }
  .rv-table td[data-label="Select"]            { grid-area: chk; align-self: start; padding-top: 2px; text-align: left; width: auto; }
  .rv-table td[data-label="Tracking No"]       { grid-area: track; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rv-table td[data-label="Receive Status"]    { grid-area: recv; justify-self: end; }
  .rv-table td[data-label="Order No"]          { grid-area: order; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rv-table td[data-label="Dim Status"]        { grid-area: dimst; justify-self: end; }
  .rv-table td[data-label="Items"]             { grid-area: items; max-width: none !important; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rv-table td[data-label="Dimensions or CBM"] { grid-area: size; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rv-table td[data-label=""]                  { grid-area: act; justify-self: end; }
  .rv-table td[data-label="Status"],
  .rv-table td[data-label="Freight Order"]     { display: none; }
  .rv-table td[data-label=""] .it-btn { padding: 4px 10px; font-size: var(--fs-xs); }
  .rv-table .rv-receive-btn { padding: 1px 8px 1px 10px; min-width: 0; font-size: var(--fs-xs); }
  .rv-table .dim-status-recorded,
  .rv-table .dim-status-pending,
  .rv-table .dim-status-item { padding: 1px 6px; font-size: var(--fs-xxs); white-space: nowrap; }
}

/* --- Receiving Shipment: receive status toggle button --- */
.rv-receive-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-width: 64px; padding: 4px 10px 4px 14px;
  border-radius: 20px; border: 1px solid;
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 600; line-height: 1.5;
  cursor: pointer; transition: all .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.rv-receive-btn .rv-receive-caret { font-size: var(--fs-xs); opacity: .75; }
.rv-receive-btn:hover { box-shadow: 0 2px 6px rgba(0,0,0,.15); transform: translateY(-1px); }
.rv-receive-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rv-receive-btn.yes { background: #dcfce7; color: #16a34a; border-color: #86efac; }
.rv-receive-btn.yes:hover { background: #bbf7d0; }
.rv-receive-btn.no  { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.rv-receive-btn.no:hover  { background: #fecaca; }

/* --- Receiving Shipment: bulk select + bulk apply dimensions --- */
.rv-bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 8px; font-size: var(--fs-sm); color: var(--text-2);
}
.rv-check-col { width: 36px; text-align: center; }
.rv-check-col input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.rv-bulk-list {
  margin-top: 10px; max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.rv-bulk-list-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 10px; font-size: var(--fs-sm); border-bottom: 1px solid var(--border);
}
.rv-bulk-list-row:last-child { border-bottom: none; }

/* --- Receiving Shipment: dimension status badges --- */
.dim-status-recorded,
.dim-status-pending,
.dim-status-item {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #000;

}
.dim-status-recorded { background: #4caf50; }
.dim-status-pending  { background: #f44336; }
.dim-status-item     { background: #2196f3; }

/* --- Shipments: cost breakdown expanded view --- */
.it-shipment-costs {
  padding: 12px 16px;
  background: var(--bg-card);
}
.it-costs-header {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.it-costs-header-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.it-costs-label {
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.it-costs-order-header {
  padding: 8px 0 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.it-costs-table {
  margin-bottom: 4px;
}
.it-costs-table th {
  font-size: var(--fs-xs);
  padding: 4px 8px;
  white-space: nowrap;
}
.it-costs-table td {
  padding: 4px 8px;
  font-size: var(--fs-sm);
}
.it-costs-order-total {
  display: flex;
  gap: 4px;
  padding: 4px 8px 10px 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}
.it-costs-overall {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding: 12px 0 4px;
  border-top: 2px solid var(--border);
  margin-top: 8px;
}
.it-costs-overall-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Shipments: cost breakdown per order --- */
.it-costs-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 6px 8px 10px 8px;
  font-size: var(--fs-xs);
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}
.it-costs-breakdown span {
  white-space: nowrap;
}

/* --- Per-item cost breakdown table (Orders page expanded row) --- */
.it-item-costs { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.it-item-costs-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.it-item-costs-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.it-item-costs-table th { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-2); white-space: nowrap; border-right:1px solid var(--border); }
.it-item-costs-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); border-right:1px solid var(--border); }
.it-item-costs-table td.num { text-align: left; font-family: var(--mono); white-space: nowrap; }
.it-item-costs-table td.total { font-weight: 600; }
.it-item-costs-table td.dims { font-size: var(--fs-xxs); }
.it-item-costs-table td.item-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-item-costs-table .na { color: var(--text-3); }
.it-item-costs-table .pending { color: var(--warning); font-size: var(--fs-xxs); }
.it-item-costs-table .tag { font-size: 10px; background: var(--warning-l); padding: 1px 4px; border-radius: 3px; }

/* --- Dimension inputs in order form --- */
.it-field-dim { display: flex; align-items: center; gap: 2px; }
.it-input-dim { width: 52px; text-align: center; font-size: var(--fs-xs); padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); }
.it-input-dim:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-l); }
.it-dim-sep { color: var(--text-3); font-size: var(--fs-xs); }

/* ── Per-item cost reconciliation ── */
.it-reconcile-row { padding: 8px 12px; margin-top: 6px; background: var(--bg-1); border: 1px solid var(--border); border-radius: 6px; }
.it-reconcile-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.it-reconcile-val { font-size: var(--fs-xs); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.it-reconcile-old { color: var(--text-2); }
.it-reconcile-new { color: var(--text-2); }
.it-reconcile-sep { color: var(--text-3); font-size: var(--fs-xxs); }
.it-reconcile-match { font-weight: 600; font-size: var(--fs-xs); padding: 1px 6px; border-radius: 4px; }
.it-reconcile-match.ok { color: var(--success); background: var(--success-l, #e8f5e9); }
.it-reconcile-match.mismatch { color: var(--danger); background: var(--danger-l, #ffebee); }

/* --- Orders: New Order "Fill from screenshot" panel --- */
.it-fill-panel {
  margin: 0 0 16px; padding: 10px 12px;
  border: 1px dashed var(--border); border-radius: 8px; background: var(--bg);
}
.it-fill-head { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.it-fill-note { font-size: var(--fs-xs); color: var(--text-2); }
.it-fill-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.it-fill-text { width: 100%; box-sizing: border-box; margin-top: 4px; font-family: var(--mono); font-size: var(--fs-xs); min-height: 60px; }
.it-fill-ok   { font-size: var(--fs-xs); color: var(--success); }
.it-fill-err  { margin-top: 6px; font-size: var(--fs-xs); color: var(--danger); }
.it-fill-warn { margin-top: 4px; font-size: var(--fs-xs); color: var(--warning); }

/* ── Starter's Guide ─────────────────────────────────────────────────────── */
.it-guide h2 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: 8px; }
.it-guide h4 { font-size: var(--fs-base); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.it-guide p { color: var(--text-2); }
.it-guide-hero p { max-width: 760px; }
.it-guide-h { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 28px 0 12px; }
.it-guide-journey { list-style: none; padding: 0; margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: none; }
.it-guide-journey li { position: relative; text-align: center; padding: 0 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.it-guide-journey li + li::before { content: '→'; position: absolute; left: -10px; top: 14px; color: var(--text-3); font-size: 20px; }
.it-guide-journey-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--primary-l); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 6px; }
.it-guide-journey-label { font-weight: 600; }
.it-guide-journey-sub { font-size: var(--fs-xs); color: var(--text-2); }
.it-guide-steps { display: flex; flex-direction: column; gap: 0; }
.it-guide-step { display: flex; gap: 16px; position: relative; padding-bottom: 14px; }
.it-guide-step:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--border); }
.it-guide-step-num { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.it-guide-step-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px 20px; }
.it-guide-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.it-guide-step-head h4 { margin-bottom: 6px; }
.it-guide-when { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.it-guide-step ul, .it-guide-tips { padding-left: 18px; margin-bottom: 12px; color: var(--text-2); }
.it-guide-step li, .it-guide-tips li { margin-bottom: 4px; }
.it-guide-step li strong, .it-guide-tips li strong { color: var(--text); font-weight: 600; }
.it-guide-tips { margin-bottom: 0; }
.it-guide-cost { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.it-guide-cost-part { flex: 1 1 120px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.it-guide-cost-part span { font-size: var(--fs-xs); color: var(--text-2); }
.it-guide-cost-total { background: var(--success-l); border-color: var(--success); }
.it-guide-cost-op { display: flex; align-items: center; font-size: 20px; color: var(--text-3); }
.it-guide-note { margin-top: 12px; font-size: var(--fs-sm); }
.it-guide-optional { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.it-guide-optional p { font-size: var(--fs-sm); margin-bottom: 12px; }
.it-guide-pill { font-size: var(--fs-nano); font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface2); color: var(--text-3); border: 1px solid var(--border); }
.it-guide-pill.on { background: var(--success-l); color: var(--success); border-color: var(--success); }
@media (max-width: 768px) {
  .it-guide-journey { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .it-guide-journey li:nth-child(3)::before { display: none; }
  .it-guide-optional { grid-template-columns: 1fr; }
  .it-guide-cost-op { width: 100%; justify-content: center; font-size: 16px; }
  .it-guide-cost-part { flex-basis: 100%; }
  .it-guide-step { gap: 10px; }
  .it-guide-step-body { padding: 14px 16px; }
}

/* ── Bank Accounts (manual funding accounts) ─────────────────────────────── */
.it-badge-purple { background: #f5f3ff; color: #7c3aed; }
.it-topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.it-funds-picker { max-width: 220px; }
.it-funds .it-stats { margin-bottom: 16px; }
.it-funds-warn { background: var(--warning-l); color: var(--warning); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: var(--fs-sm); }
.it-funds-error { background: var(--danger-l); color: var(--danger); border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; font-size: var(--fs-sm); }
.it-funds-error ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.it-funds-ok { background: var(--success-l); color: var(--success); border-radius: var(--radius); padding: 10px 12px; font-size: var(--fs-sm); }
.it-funds-check { margin-bottom: 12px; }
.it-funds-new { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; flex-wrap: wrap; }
.it-funds-new .it-input { flex: 1 1 200px; }
.it-funds-new .it-select { flex: 0 0 90px; }
.it-funds-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.it-funds-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.it-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.it-chip.active { background: var(--primary-l); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.it-funds-search { max-width: 260px; }
.it-funds-table th.num, .it-funds-table td.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.it-funds-table th, .it-funds-table td { padding-left: 10px; padding-right: 10px; }
.it-funds-table th:first-child, .it-funds-table td:first-child { padding-left: 20px; white-space: nowrap; }
.it-funds-table th:last-child, .it-funds-table td:last-child { padding-right: 20px; }
.it-funds-table td .actions { flex-wrap: nowrap; }
.it-funds-table td:nth-child(9) { white-space: nowrap; }
.it-funds-in { color: var(--success); }
.it-funds-out { color: var(--text); }
.it-funds-bad { color: var(--danger); font-weight: 600; font-size: var(--fs-xs); }
.it-funds-muted { color: var(--text-3); font-size: var(--fs-xs); }
.it-funds-ref { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-funds-note { color: var(--text-3); }
.it-funds-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.it-funds-hint { font-size: var(--fs-xs); color: var(--text-3); margin-left: auto; }
.it-funds-types { flex-wrap: wrap; }
.it-funds-computed { display: flex; align-items: center; background: var(--surface2); color: var(--text-2); }
.it-funds-p { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 10px; }
.it-funds-list { padding-left: 18px; }
.it-funds-list li { margin-bottom: 4px; }
.it-funds-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.it-funds-cols code { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-family: var(--mono); font-size: var(--fs-xs); }
.it-funds-upload { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.it-funds-preview { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.it-funds-preview .it-table th:first-child, .it-funds-preview .it-table td:first-child { padding-left: 12px; }
.it-funds-badrow td { background: var(--danger-l); }
@media (max-width: 768px) {
  .it-funds .it-topbar { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  .it-funds-picker { max-width: none; flex: 1 1 100%; order: 3; }
  .it-funds-search { max-width: none; flex: 1 1 100%; }
  .it-funds-hint { margin-left: 0; flex-basis: 100%; }
  /* Transactions stack as cards */
  .it-funds-table thead { display: none; }
  .it-funds-table, .it-funds-table tbody, .it-funds-table tr, .it-funds-table td { display: block; width: 100%; }
  .it-funds-table tr { border-bottom: 1px solid var(--border); padding: 10px 14px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .it-funds-table td { padding: 3px 0 !important; border: 0; text-align: left !important; }
  .it-funds-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-nano); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-family: var(--font); }
  .it-funds-table td:last-child { grid-column: 1 / -1; }
  .it-funds-table td[colspan] { grid-column: 1 / -1; }
  .it-funds-ref { max-width: none; white-space: normal; }
  .it-funds .it-table-wrap { max-height: none; overflow: visible; }
}
.it-funds-del:hover { color: var(--danger); background: var(--danger-l); }

/* Starter's Guide: multi-line orders */
#import-tracker-app .it-guide-multi h4 { margin: 22px 0 8px; }
#import-tracker-app .it-guide-multi h4:first-of-type { margin-top: 16px; }
#import-tracker-app .it-guide-multi > p { margin-bottom: 8px; }
#import-tracker-app .it-guide-multi .it-guide-note { margin: 8px 0 0; }
#import-tracker-app .it-guide-multi .it-table-wrap { margin: 8px 0; }
.it-guide-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.it-guide-fields div { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.it-guide-fields span { font-size: var(--fs-xs); color: var(--text-2); }
.it-guide-table { border: 1px solid var(--border); border-radius: var(--radius); }
.it-guide-table th, .it-guide-table td { padding: 8px 12px !important; font-size: var(--fs-sm); white-space: normal; }
.it-guide-table th.num, .it-guide-table td.num { text-align: right; white-space: nowrap; }
.it-guide-multi .it-table-wrap { max-height: none; margin: 8px 0; }
.it-guide-calc { background: var(--surface2); border-radius: var(--radius); padding: 10px 14px; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); }
.it-guide-calc strong { font-family: var(--font); }
.it-guide-calc-check { color: var(--success); font-family: var(--font); }
@media (max-width: 768px) {
  .it-guide-fields { grid-template-columns: 1fr 1fr; }
  .it-guide-calc { font-size: var(--fs-xs); }
  /* guide tables stack as cards */
  .it-guide-table thead { display: none; }
  .it-guide-table, .it-guide-table tbody, .it-guide-table tr, .it-guide-table td { display: block; width: 100%; }
  .it-guide-table tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
  .it-guide-table td { padding: 3px 8px !important; border: 0; text-align: left !important; white-space: normal !important; }
  .it-guide-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-nano); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
  #import-tracker-app .it-guide-multi .it-table-wrap { overflow: visible; }
}

/* Order form: uneven line data warning (Multiple SKUs) */
.it-line-warn { font-family: var(--font); background: var(--warning-l); color: var(--warning); border: 1px solid #fde68a; border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; font-size: var(--fs-sm); }
.it-line-warn-title { font-weight: 600; margin-bottom: 4px; }
#import-tracker-app .it-line-warn ul, .it-line-warn ul { margin: 0 0 6px; padding-left: 18px; }
.it-line-warn li { margin-bottom: 2px; }
.it-line-warn-foot { font-size: var(--fs-xs); color: var(--text-2); }

/* Finance menu: bank account names can be long */
.it-nav-item .it-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
