:root {
  /* shell */
  --sidebar-bg:        #12141c;
  --sidebar-fg:        #d5d8de;
  --sidebar-fg-muted:  #8b909b;
  --sidebar-active-bg: #1e2230;
  --sidebar-hover-bg:  #191d28;
  --sidebar-border:    #262b38;
  --app-bg:            #ffffff;
  --surface:           #ffffff;
  --border:            #dee2e6;
  --border-subtle:     #e9ecef;
  --text:              #212529;
  --text-muted:        #6c757d;
  --primary-fg: #ffffff;
  --count-accent-bg: #0a58ca;
  --count-accent-fg: #ffffff;

  /* semantic (Bootstrap 5 parity) */
  --primary:   #0d6efd;   --primary-hover: #0b5ed7;
  --success:   #198754;
  --warning:   #ffc107;   --warning-fg: #000000;
  --warning-text: #b45309;
  --info:      #0dcaf0;   --info-fg: #000000;
  --danger:    #dc3545;
  --alert-info-bg: #cff4fc; --alert-info-fg: #055160; --alert-info-border: #b6effb;
  --alert-success-bg: #d1e7dd; --alert-success-fg: #0f5132; --alert-success-border: #a3cfbb;
  --alert-neutral-bg: #f8f9fa; --alert-neutral-fg: #495057; --alert-neutral-border: #dee2e6;

  /* channel pills */
  --ch-shopify:     #22c55e;
  --ch-woocommerce: #7f54b3;
  --ch-b2b:         #2563eb;
  --ch-shiprazor:   #0f766e;

  /* status badges */
  --badge-inprogress-bg: #ffc107;  --badge-inprogress-fg: #1f2937;
  --badge-outstanding-bg:#17a2b8;  --badge-outstanding-fg:#ffffff;
  --badge-ready-bg:      #16a34a;  --badge-ready-fg:      #ffffff;
  --badge-paid-bg:       #198754;  --badge-paid-fg:      #ffffff;
  --badge-packed-bg:     #198754;  --badge-packed-fg:    #ffffff;
  --badge-dispatched-bg: #0d6efd;  --badge-dispatched-fg:#ffffff;
  --badge-unfulfilled-bg:#ffffff;  --badge-unfulfilled-fg:#495057;
                                   --badge-unfulfilled-border:#ced4da;

  --sidebar-width: 215px;
  --sidebar-collapsed: 56px;
  --footer-btn-bg: #1b1f2b;
  --footer-btn-hover: #232838;
  --table-header-bg: #f8f9fa;
  --active-sub: #2a3040;
  --radius: 4px;
  --radius-group: 6px;
  --pack-complete-bg: #d1e7dd;
  --pack-complete-border: #198754;
  --pack-incomplete-bg: #fff4e5;
  --pack-incomplete-border: #fd7e14;
  --row-low-bg: #fff6e5;
  --row-low-border: #fd7e14;
  --row-oos-bg: #fdecec;
  --row-oos-border: #dc3545;
}

html[data-theme="dark"] {
  --sidebar-bg: #0b0d12;
  --sidebar-fg: #e8eaed;
  --sidebar-fg-muted: #9aa0a6;
  --sidebar-active-bg: #161a22;
  --sidebar-hover-bg: #12151c;
  --sidebar-border: #2a2f3a;
  --app-bg: #0f1115;
  --surface: #161a22;
  --border: #2c3340;
  --border-subtle: #232833;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --primary: #0d6efd;
  --primary-hover: #3d8bfd;
  --table-header-bg: #1c212c;
  --footer-btn-bg: #12151c;
  --footer-btn-hover: #1c212c;
  --active-sub: #1e2430;
}

html[data-theme="graphite"] {
  --sidebar-bg: #2b2f36;
  --sidebar-fg: #f3f4f6;
  --sidebar-fg-muted: #c5c9d0;
  --sidebar-active-bg: #3a3f48;
  --sidebar-hover-bg: #343940;
  --sidebar-border: #4b515c;
  --app-bg: #1f2329;
  --surface: #2b2f36;
  --border: #4b515c;
  --border-subtle: #3a3f48;
  --text: #f3f4f6;
  --text-muted: #c5c9d0;
  --primary: #e5e7eb;
  --primary-hover: #f9fafb;
  --primary-fg: #1f2329;
  --count-accent-bg: var(--primary);
  --count-accent-fg: var(--primary-fg);
  --table-header-bg: #343940;
  --footer-btn-bg: #23272e;
  --footer-btn-hover: #3a3f48;
  --active-sub: #3a3f48;
}

html[data-theme="emerald-dark"] {
  --sidebar-bg: #06140d;
  --sidebar-fg: #d8f3e2;
  --sidebar-fg-muted: #7dba94;
  --sidebar-active-bg: #0d2418;
  --sidebar-hover-bg: #0a1c13;
  --sidebar-border: #164a32;
  --app-bg: #07150e;
  --surface: #0d2418;
  --border: #1b5c3d;
  --border-subtle: #123525;
  --text: #e8f8ee;
  --text-muted: #8ec9a6;
  --primary: #22c55e;
  --primary-hover: #4ade80;
  --table-header-bg: #123525;
  --footer-btn-bg: #0a1c13;
  --footer-btn-hover: #123525;
  --active-sub: #164a32;
}

html[data-theme="warm-light"] {
  --sidebar-bg: #3d2a24;
  --sidebar-fg: #f8efe8;
  --sidebar-fg-muted: #d4b8ab;
  --sidebar-active-bg: #4d352d;
  --sidebar-hover-bg: #46302a;
  --sidebar-border: #5c4036;
  --app-bg: #faf4ee;
  --surface: #fffaf5;
  --border: #e8d5c8;
  --border-subtle: #f0e4da;
  --text: #3d2a24;
  --text-muted: #8a6a5c;
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --table-header-bg: #f4e8de;
  --footer-btn-bg: #4d352d;
  --footer-btn-hover: #5c4036;
  --active-sub: #5c4036;
}

html[data-theme="ocean"] {
  --sidebar-bg: #061525;
  --sidebar-fg: #d7eef8;
  --sidebar-fg-muted: #7aa8c2;
  --sidebar-active-bg: #0b2438;
  --sidebar-hover-bg: #082033;
  --sidebar-border: #163a54;
  --app-bg: #071a2c;
  --surface: #0b2438;
  --border: #1a4a6a;
  --border-subtle: #123044;
  --text: #e6f4fb;
  --text-muted: #8ab4cc;
  --primary: #22d3ee;
  --primary-hover: #67e8f9;
  --table-header-bg: #123044;
  --footer-btn-bg: #082033;
  --footer-btn-hover: #123044;
  --active-sub: #163a54;
}

html[data-theme="rose"] {
  --sidebar-bg: #2a0f1c;
  --sidebar-fg: #fde8f0;
  --sidebar-fg-muted: #d48aa8;
  --sidebar-active-bg: #3d1728;
  --sidebar-hover-bg: #341522;
  --sidebar-border: #5c2440;
  --app-bg: #1f0c16;
  --surface: #3d1728;
  --border: #6b2b49;
  --border-subtle: #4a1c32;
  --text: #fde8f0;
  --text-muted: #d48aa8;
  --primary: #ec4899;
  --primary-hover: #f472b6;
  --table-header-bg: #4a1c32;
  --footer-btn-bg: #341522;
  --footer-btn-hover: #4a1c32;
  --active-sub: #5c2440;
}

html[data-theme="high-contrast"] {
  --sidebar-bg: #000000;
  --sidebar-fg: #ffffff;
  --sidebar-fg-muted: #d4d4d4;
  --sidebar-active-bg: #1a1a1a;
  --sidebar-hover-bg: #111111;
  --sidebar-border: #333333;
  --app-bg: #000000;
  --surface: #0a0a0a;
  --border: #ffffff;
  --border-subtle: #333333;
  --text: #ffffff;
  --text-muted: #d4d4d4;
  --primary: #facc15;
  --primary-hover: #fde047;
  --primary-fg: #000000;
  --count-accent-bg: var(--primary);
  --count-accent-fg: var(--primary-fg);
  --table-header-bg: #1a1a1a;
  --footer-btn-bg: #111111;
  --footer-btn-hover: #1a1a1a;
  --active-sub: #1a1a1a;
}

html[data-theme="sand"] {
  --sidebar-bg: #4a3728;
  --sidebar-fg: #f6efe6;
  --sidebar-fg-muted: #d2c0ae;
  --sidebar-active-bg: #5c4634;
  --sidebar-hover-bg: #533f2e;
  --sidebar-border: #6b5340;
  --app-bg: #f4eadc;
  --surface: #fbf6ef;
  --border: #dfd0bc;
  --border-subtle: #ebe0d0;
  --text: #3f2f22;
  --text-muted: #7a6550;
  --primary: #8b5e34;
  --primary-hover: #6f4b2a;
  --table-header-bg: #ece1d1;
  --footer-btn-bg: #5c4634;
  --footer-btn-hover: #6b5340;
  --active-sub: #6b5340;
}

html[data-theme="slate"] {
  --sidebar-bg: #1e293b;
  --sidebar-fg: #e2e8f0;
  --sidebar-fg-muted: #94a3b8;
  --sidebar-active-bg: #273549;
  --sidebar-hover-bg: #243044;
  --sidebar-border: #334155;
  --app-bg: #f1f5f9;
  --surface: #ffffff;
  --border: #cbd5e1;
  --border-subtle: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --table-header-bg: #e8eef5;
  --footer-btn-bg: #273549;
  --footer-btn-hover: #334155;
  --active-sub: #334155;
}

html[data-theme="forest"] {
  --sidebar-bg: #142015;
  --sidebar-fg: #e4f0dc;
  --sidebar-fg-muted: #9bb58a;
  --sidebar-active-bg: #1d2e1f;
  --sidebar-hover-bg: #182618;
  --sidebar-border: #2f4a30;
  --app-bg: #121c13;
  --surface: #1d2e1f;
  --border: #355436;
  --border-subtle: #243826;
  --text: #eaf3e4;
  --text-muted: #a3b894;
  --primary: #84cc16;
  --primary-hover: #a3e635;
  --table-header-bg: #243826;
  --footer-btn-bg: #182618;
  --footer-btn-hover: #243826;
  --active-sub: #2f4a30;
}

html[data-theme="sunset"] {
  --sidebar-bg: #4a1f1a;
  --sidebar-fg: #ffece7;
  --sidebar-fg-muted: #e0b0a6;
  --sidebar-active-bg: #5c2a23;
  --sidebar-hover-bg: #53251f;
  --sidebar-border: #6e3530;
  --app-bg: #fff1ea;
  --surface: #fff8f4;
  --border: #f0cfc4;
  --border-subtle: #f7e0d8;
  --text: #3f1c18;
  --text-muted: #9a5a4e;
  --primary: #f97316;
  --primary-hover: #ea580c;
  --table-header-bg: #fde6dc;
  --footer-btn-bg: #5c2a23;
  --footer-btn-hover: #6e3530;
  --active-sub: #6e3530;
}

html[data-theme="midnight"] {
  --sidebar-bg: #070b1a;
  --sidebar-fg: #e8ecff;
  --sidebar-fg-muted: #9aa3d0;
  --sidebar-active-bg: #10183a;
  --sidebar-hover-bg: #0c1330;
  --sidebar-border: #1c2758;
  --app-bg: #080d20;
  --surface: #10183a;
  --border: #24306a;
  --border-subtle: #161f48;
  --text: #eef1ff;
  --text-muted: #a8b0d8;
  --primary: #eab308;
  --primary-hover: #facc15;
  --primary-fg: #080d20;
  --count-accent-bg: var(--primary);
  --count-accent-fg: var(--primary-fg);
  --table-header-bg: #161f48;
  --footer-btn-bg: #0c1330;
  --footer-btn-hover: #161f48;
  --active-sub: #1c2758;
}

html[data-theme="lavender"] {
  --sidebar-bg: #3b2a55;
  --sidebar-fg: #f4ecff;
  --sidebar-fg-muted: #cbb9e4;
  --sidebar-active-bg: #4a3668;
  --sidebar-hover-bg: #43305e;
  --sidebar-border: #5b447c;
  --app-bg: #f6f1fb;
  --surface: #fcf9ff;
  --border: #e0d4f0;
  --border-subtle: #ece4f6;
  --text: #2e2044;
  --text-muted: #6f5b8a;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --table-header-bg: #eee6f8;
  --footer-btn-bg: #4a3668;
  --footer-btn-hover: #5b447c;
  --active-sub: #5b447c;
}

html[data-theme="copper"] {
  --sidebar-bg: #1c120c;
  --sidebar-fg: #f6e7d8;
  --sidebar-fg-muted: #c4a078;
  --sidebar-active-bg: #2a1b12;
  --sidebar-hover-bg: #23160f;
  --sidebar-border: #3d281b;
  --app-bg: #140e0a;
  --surface: #2a1b12;
  --border: #4a3222;
  --border-subtle: #322015;
  --text: #f8eadc;
  --text-muted: #c4a078;
  --primary: #d97706;
  --primary-hover: #f59e0b;
  --table-header-bg: #322015;
  --footer-btn-bg: #23160f;
  --footer-btn-hover: #322015;
  --active-sub: #3d281b;
}

html[data-theme="ice"] {
  --sidebar-bg: #1b3a4a;
  --sidebar-fg: #e7f6fb;
  --sidebar-fg-muted: #9ec4d2;
  --sidebar-active-bg: #244859;
  --sidebar-hover-bg: #204252;
  --sidebar-border: #2f5b6e;
  --app-bg: #eef6f9;
  --surface: #f7fbfc;
  --border: #c9dde6;
  --border-subtle: #dceaf0;
  --text: #16323d;
  --text-muted: #5b7d8a;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --table-header-bg: #e3f0f5;
  --footer-btn-bg: #244859;
  --footer-btn-hover: #2f5b6e;
  --active-sub: #2f5b6e;
}

html[data-theme="ocean"],
html[data-theme="forest"],
html[data-theme="ice"] {
  --count-accent-bg: var(--primary);
  --count-accent-fg: #082f49;
}

html[data-theme="dark"],
html[data-theme="graphite"],
html[data-theme="emerald-dark"],
html[data-theme="ocean"],
html[data-theme="rose"],
html[data-theme="forest"],
html[data-theme="midnight"],
html[data-theme="copper"] {
  --row-low-bg: #3a2e18;
  --row-low-border: #fd7e14;
  --row-oos-bg: #3a1c22;
  --row-oos-border: #f87171;
  --pack-complete-bg: #163326;
  --pack-complete-border: #22c55e;
  --pack-incomplete-bg: #3a2e18;
  --pack-incomplete-border: #fd7e14;
  --alert-info-bg: #0c3a45;
  --alert-info-fg: #9eeaf9;
  --alert-info-border: #167d8f;
  --alert-success-bg: #163326;
  --alert-success-fg: #86efac;
  --alert-success-border: #198754;
  --alert-neutral-bg: #1c212c;
  --alert-neutral-fg: #9aa0a6;
  --alert-neutral-border: #2c3340;
  --warning-text: #fbbf24;
}

html[data-theme="high-contrast"] {
  --row-low-bg: #1a1400;
  --row-low-border: #facc15;
  --row-oos-bg: #1a0000;
  --row-oos-border: #ffffff;
  --pack-complete-bg: #001a0a;
  --pack-complete-border: #22c55e;
  --pack-incomplete-bg: #1a1400;
  --pack-incomplete-border: #facc15;
  --alert-info-bg: #001a1a;
  --alert-info-fg: #ffffff;
  --alert-info-border: #ffffff;
  --alert-success-bg: #001a0a;
  --alert-success-fg: #ffffff;
  --alert-success-border: #22c55e;
  --alert-neutral-bg: #000000;
  --alert-neutral-fg: #ffffff;
  --alert-neutral-border: #ffffff;
  --warning-text: #facc15;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--app-bg);
  margin: 0;
  --bs-body-bg: var(--app-bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-secondary-bg: var(--table-header-bg);
  --bs-border-color: var(--border);
  --bs-form-control-bg: var(--surface);
  --bs-tertiary-bg: var(--table-header-bg);
  --bs-emphasis-color: var(--text);
}

.phoera-shell {
  min-height: 100vh;
}

.phoera-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.phoera-brand {
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.phoera-brand-name {
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.phoera-brand-url {
  color: var(--sidebar-fg-muted);
  font-size: 9.5px;
  line-height: 1.2;
}

.phoera-nav {
  flex: 1;
  padding: 8px 8px 12px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.phoera-nav::-webkit-scrollbar {
  display: none;
}

.phoera-nav .nav-item,
.phoera-nav .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  color: var(--sidebar-fg);
  font-size: 13.5px;
  text-decoration: none;
  border-radius: var(--radius);
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.phoera-nav .nav-item:hover,
.phoera-nav .nav-group-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-fg);
}

.phoera-nav .nav-item i,
.phoera-nav .nav-group-toggle i.nav-icon {
  font-size: 16px;
  width: 16px;
  text-align: center;
}

.nav-chevron {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.15s ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-group {
  border-radius: var(--radius-group);
}

.nav-group.open.active-group {
  background: var(--sidebar-active-bg);
  border: 1px solid var(--sidebar-border);
}

.nav-sub {
  display: none;
  padding: 4px 0 6px;
}

.nav-group.open .nav-sub {
  display: block;
}

.nav-sub a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 12px 0 28px;
  color: var(--sidebar-fg);
  font-size: 12.5px;
  text-decoration: none;
  border-radius: var(--radius);
}

.nav-sub a i {
  font-size: 14px;
  width: 14px;
}

.nav-sub a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-fg);
}

.nav-sub a.active {
  background: var(--active-sub);
  color: #ffffff;
  font-weight: 600;
}

.phoera-sidebar-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--sidebar-border);
  padding: 10px 10px 12px;
}

.phoera-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--sidebar-fg);
  font-size: 13px;
}

.phoera-user-row i {
  font-size: 18px;
}

.role-badge {
  font-size: 10.5px;
  border-radius: 3px;
  padding: 1px 6px;
  font-weight: 600;
  margin-left: auto;
  color: var(--primary-fg);
}

.role-badge.ADMIN { background: var(--primary); }
.role-badge.MANAGER { background: var(--info); color: var(--info-fg); }
.role-badge.PACKER { background: var(--success); }
.role-badge.RECEIVER { background: var(--warning); color: var(--warning-fg); }
.role-badge.VIEWER { background: var(--text-muted); }

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  font-size: 12.5px;
  background: var(--footer-btn-bg);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-fg);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}

.sidebar-btn + .sidebar-btn {
  margin-top: 6px;
}

.sidebar-btn:hover {
  background: var(--footer-btn-hover);
  color: var(--sidebar-fg);
}

.phoera-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--app-bg);
}

.phoera-content {
  padding: 16px;
}

.phoera-main:has(.products-page),
.phoera-content:has(.products-page) {
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.phoera-content:has(.products-page) {
  display: flex;
  flex-direction: column;
}

.products-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.products-page > .page-header {
  flex-shrink: 0;
}

.products-page-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#product-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.flash-toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.flash-banner {
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-fg);
  font-size: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  pointer-events: auto;
}

.flash-banner--error {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--primary-fg);
}

.corner-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  background: var(--danger);
  color: var(--primary-fg);
  font-size: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
}

.flash-banner .btn-close {
  font-size: 12px;
}

.flash-banner--error .btn-close {
  filter: invert(1) grayscale(100%);
}

html[data-theme="dark"] .flash-banner .btn-close,
html[data-theme="graphite"] .flash-banner .btn-close,
html[data-theme="emerald-dark"] .flash-banner .btn-close,
html[data-theme="ocean"] .flash-banner .btn-close,
html[data-theme="rose"] .flash-banner .btn-close,
html[data-theme="forest"] .flash-banner .btn-close,
html[data-theme="midnight"] .flash-banner .btn-close,
html[data-theme="copper"] .flash-banner .btn-close,
html[data-theme="high-contrast"] .flash-banner .btn-close {
  filter: invert(1) grayscale(100%);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 12px;
}

.page-header-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header-title i {
  font-size: 20px;
  color: var(--primary);
}

.page-header-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.page-header .filter-bar {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.page-header .input-group.filter-search {
  width: 220px;
  height: 28px;
}

.page-header .filter-bar .filter-select {
  width: 128px;
  height: 28px;
  font-size: 12.5px;
}

.page-header .filter-bar .form-select,
.page-header .filter-bar .form-control,
.page-header .filter-bar .input-group-text {
  height: 28px;
  min-height: 28px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 12.5px;
  line-height: 1.2;
}

.page-header .filter-bar .input-group-text {
  padding-left: 8px;
  padding-right: 6px;
}

.btn-outline-primary.phoera-outline {
  height: 30px;
  font-size: 13px;
  border-radius: var(--radius);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  color: var(--text);
  background: var(--surface);
  border-color: var(--text-muted);
}

.btn-outline-primary.phoera-outline:hover,
.btn-outline-primary.phoera-outline:focus-visible {
  color: var(--primary-fg);
  background: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary.phoera-outline i {
  font-size: 14px;
}

.count-pill,
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.count-pill {
  color: var(--primary-fg);
}

.channel-pill {
  color: #fff;
  font-size: 11.5px;
}

.channel-pill i,
.count-pill i {
  font-size: 13px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-search {
  width: 280px;
  height: 32px;
  font-size: 13.5px;
  border-radius: var(--radius);
}

.filter-select {
  width: 150px;
  height: 32px;
  font-size: 13.5px;
  border-radius: var(--radius);
}

.filter-bar .btn {
  height: 32px;
  border-radius: var(--radius);
  box-shadow: none;
  font-size: 13.5px;
}

.phoera-card,
.table-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
}

.table-card table {
  margin: 0;
  width: 100%;
}

.table-card thead th {
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  height: 40px;
  padding: 0 12px;
  vertical-align: middle;
}

.table-card tbody td {
  height: 44px;
  padding: 0 12px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.table-card tbody tr:hover td {
  background: var(--table-header-bg);
}

.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.status-badge i { font-size: 12px; }

.status-badge.inprogress {
  background: var(--badge-inprogress-bg);
  color: var(--badge-inprogress-fg);
}
.status-badge.outstanding {
  background: var(--badge-outstanding-bg);
  color: var(--badge-outstanding-fg);
}
.status-badge.ready {
  background: var(--badge-ready-bg);
  color: var(--badge-ready-fg);
}
.status-badge.paid {
  background: var(--badge-paid-bg);
  color: var(--badge-paid-fg);
}
.status-badge.packed {
  background: var(--badge-packed-bg);
  color: var(--badge-packed-fg);
}
.status-badge.dispatched {
  background: var(--badge-dispatched-bg);
  color: var(--badge-dispatched-fg);
}
.status-badge.unfulfilled {
  background: var(--badge-unfulfilled-bg);
  color: var(--badge-unfulfilled-fg);
  border: 1px solid var(--badge-unfulfilled-border);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  border: 0;
  box-shadow: none;
  text-decoration: none;
}
.action-btn.start { background: var(--primary); color: var(--primary-fg); }
.action-btn.resume-progress { background: var(--warning); color: var(--warning-fg); }
.action-btn.resume-outstanding { background: var(--info); color: var(--info-fg); }
.action-btn.locked { background: var(--border-subtle); color: var(--text-muted); }
.action-btn-form { display: inline; margin: 0; }
.action-btn.mark-paid { background: var(--badge-paid-bg); color: var(--badge-paid-fg); }
.action-btn.takeover { background: var(--warning); color: var(--warning-fg); }
.action-btn.hold { background: var(--border-subtle); color: var(--text); }
.action-btn.unhold { background: var(--badge-ready-bg); color: var(--badge-ready-fg); }
.action-btn.cancel { background: var(--danger, #dc2626); color: #fff; }

.action-unpaid {
  display: inline-flex;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cline x1='4' y1='4' x2='20' y2='20' stroke='%23dc3545' stroke-width='3' stroke-linecap='round'/%3E%3Cline x1='20' y1='4' x2='4' y2='20' stroke='%23dc3545' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, not-allowed;
}
.action-unpaid .action-btn {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.6);
}
.dispatch-row--unpaid > td:not(.col-expand):not(.col-dispatch) {
  opacity: 0.55;
}

.text-muted { color: var(--text-muted) !important; }

.expand-btn {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.expand-btn.open i,
.expand-btn[class~="open"] i {
  transform: rotate(180deg);
}

[x-cloak] { display: none !important; }

.dispatch-table .col-expand { width: 44px; text-align: center; }
.dispatch-table .col-order { width: 120px; font-weight: 500; }
.dispatch-table .col-store { width: 150px; }
.dispatch-table .col-date { width: 170px; font-size: 13px; color: var(--text-muted); }
.dispatch-table .col-status { width: 170px; }
.dispatch-table .col-items { width: 90px; text-align: right; }
.dispatch-table .col-total { width: 150px; text-align: right; }
.dispatch-table .col-dispatch { width: 200px; }
.dispatch-table .total-main { font-weight: 600; font-size: 13.5px; }
.dispatch-table .total-sub { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.dispatch-table .total-sub.text-success { color: var(--success); }
.dispatch-table .col-status .status-badge { margin-right: 4px; }

.expand-row td {
  background: var(--table-header-bg);
  border-top: 1px solid var(--border);
  padding: 12px;
  height: auto;
  white-space: normal;
}

.sub-table {
  width: 100%;
  border: 0;
}
.sub-table th, .sub-table td {
  border: 0;
  background: transparent !important;
  height: 32px;
  padding: 4px 8px;
  font-size: 13px;
}

.availability-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface);
}
.availability-chip.in_stock { color: var(--success); border: 1px solid var(--success); }
.availability-chip.short { color: var(--warning-text); border: 1px solid var(--warning); }
.availability-chip.out { color: var(--danger); border: 1px solid var(--danger); }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--table-header-bg);
  padding: 16px;
  color: var(--text);
}
.login-shell {
  width: 100%;
  max-width: 400px;
}
.login-wrap .card {
  --login-radius: 6px;
  border-radius: var(--login-radius);
  border-color: var(--border);
  background: var(--surface);
}
.login-wrap .card-body {
  color: var(--text);
}
.login-wordmark {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.1;
  color: var(--text);
}
.login-wrap .form-label,
.login-wrap .form-control,
.login-wrap .form-check-label,
.login-wrap .btn {
  font-size: 16px;
}
.login-wrap .form-control {
  min-height: 38px;
  border-radius: 6px;
}
.login-wrap .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.login-wrap .input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  min-width: 42px;
}
.login-wrap .btn-primary {
  border-radius: 6px;
  min-height: 38px;
}

.pack-header {
  padding: 14px 16px;
  margin-bottom: 0;
}

.pack-header-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.pack-header-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pack-header-number {
  font-size: 18px;
  font-weight: 700;
}

.pack-header-value {
  font-size: 13.5px;
  font-weight: 500;
}

.pack-header-total {
  font-weight: 700;
}

.pack-header-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.pack-header-notes {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pack-scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 24px auto 20px;
  width: min(560px, 100%);
  padding: 12px;
  border-radius: var(--radius);
  outline: 3px solid transparent;
}

.pack-scan #pack-scan-form,
.pack-scan #pack-scan-feedback {
  width: 100%;
}

.pack-scan:has(#grn-post-wrap) {
  width: min(720px, 100%);
}

.pack-scan:has(#grn-post-wrap) #pack-scan-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 1;
  min-width: 0;
}

.pack-scan:has(#grn-post-wrap) #scan-input {
  flex: 1;
  min-width: 0;
}

@keyframes pack-scan-flash-ok {
  0%, 40% { outline-color: var(--success); }
  100% { outline-color: transparent; }
}

@keyframes pack-scan-flash-bad {
  0%, 40% { outline-color: var(--danger); }
  100% { outline-color: transparent; }
}

@keyframes pack-scan-flash-warn {
  0%, 40% { outline-color: var(--warning); }
  100% { outline-color: transparent; }
}

@keyframes pack-scan-flash-picked {
  0%, 40% { outline-color: var(--pack-incomplete-border); }
  100% { outline-color: transparent; }
}

.pack-scan.is-flashing[data-flash="ok"] {
  animation: pack-scan-flash-ok 0.6s ease-out;
}

.pack-scan.is-flashing[data-flash="unknown"],
.pack-scan.is-flashing[data-flash="empty"] {
  animation: pack-scan-flash-bad 0.6s ease-out;
}

.pack-scan.is-flashing[data-flash="over"],
.pack-scan.is-flashing[data-flash="locked"] {
  animation: pack-scan-flash-warn 0.6s ease-out;
}

.pack-scan.is-flashing[data-flash="already_picked"] {
  animation: pack-scan-flash-picked 0.6s ease-out;
}

.pack-scan-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pack-scan > .pack-scan-label {
  width: 100%;
}

.pack-scan-hint {
  margin: -4px 0 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  width: 100%;
}

.pack-scan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.pack-scan-input {
  height: 48px;
  font-size: 18px;
  text-align: center;
  border-radius: var(--radius);
}

.pack-mute {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pack-scan-submit {
  height: 48px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.pack-mute.is-muted {
  color: var(--danger);
}

.pack-scan-status {
  min-height: 24px;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

.pack-scan-status.ok { color: var(--success); }
.pack-scan-status.unknown,
.pack-scan-status.empty { color: var(--danger); }
.pack-scan-status.already_picked { color: var(--pack-incomplete-border); }
.pack-scan-status.over { color: var(--warning); }
.pack-scan-status.locked { color: var(--warning); }

.pack-recent-scans {
  margin: 10px 0 12px;
}

.pack-recent-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pack-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

#pack-products-scroll,
#grn-lines-scroll {
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

.pack-more {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.pack-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pack-workspace #grn-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  width: 100%;
  margin: 0;
}

#pack-workspace #grn-lines > .empty-state {
  grid-column: 1 / -1;
}

#pack-workspace #pack-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  width: 100%;
  margin: 0;
}

#pack-workspace #pack-products > .empty-state {
  grid-column: 1 / -1;
}

.pack-product {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  min-width: 0;
}

.pack-product--complete {
  border-color: var(--pack-complete-border);
  background: color-mix(in srgb, var(--pack-complete-border) 8%, var(--surface));
}

.pack-product--incomplete {
  background: var(--surface);
  border-color: var(--border);
}

.pack-product--requested {
  background: var(--surface);
  border-color: var(--warning);
}

.pack-product-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  display: block;
}

.pack-product .edit-line-controls {
  margin-top: 4px;
}

#pack-workspace .pack-product {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 22px 8px 10px;
  min-width: 0;
}

.pack-product-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 1;
  margin: 0;
}

.pack-product-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.pack-product-remove-btn:hover,
.pack-product-remove-btn:focus-visible {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

#pack-workspace #pack-products .pack-product {
  align-items: center;
  padding: 8px 22px 8px 10px;
  gap: 8px;
}

#pack-workspace #pack-products .pack-product-progress {
  margin-top: 4px;
}

#pack-workspace #pack-products .pack-product-qty-badge {
  margin-left: 0;
}

#pack-workspace .grn-line {
  flex-wrap: wrap;
}

#pack-workspace .pack-product-thumb {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

#pack-workspace .pack-product-image {
  grid-row: auto;
  width: 40px;
  height: 40px;
}

.pack-product-check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pack-complete-border);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.pack-product-body {
  min-width: 0;
  flex: 1;
}

.pack-product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pack-product-titles {
  min-width: 0;
  flex: 1;
}

.pack-product-sku {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.pack-product-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.pack-product-variant {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 1px;
}

.pack-product-done {
  color: var(--pack-complete-border);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.pack-product-done--short {
  color: var(--warning-text);
}

.pack-product-done--over {
  color: var(--danger);
}

.pack-product-awaiting {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.pack-product-awaiting .form-check-input {
  margin: 0;
  cursor: pointer;
}

.pack-product-top .receive-chip {
  margin-top: 0;
}

.pack-product-scan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.pack-product-qty {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.pack-product-progress {
  height: 3px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.pack-product-progress-fill {
  height: 100%;
  width: var(--pack-progress, 0%);
  background: var(--pack-complete-border);
  border-radius: inherit;
}

.pack-product-progress-fill--short {
  background: var(--warning);
}

.pack-product-progress-fill--over {
  background: var(--danger);
}

.pack-product-progress-fill--blind {
  background: var(--text-muted);
}

.pack-product-toggle {
  flex-shrink: 0;
  align-self: center;
}

.pack-product-extra {
  flex: 1 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pack-product-lots {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 0;
}

.pack-product-lots .form-control,
.pack-product-lots .form-select {
  height: 36px;
  font-size: 13.5px;
  min-width: 0;
}

.pack-product-lots .form-control {
  flex: 1 1 8rem;
}

.pack-product-extra .pack-request {
  margin-top: 0;
}

.pack-product-qty-badge {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  min-width: 32px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: var(--surface);
}

.pack-request {
  margin-top: 8px;
}

.pack-request-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.pack-request-replace {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pack-request-summary {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.pack-request-form {
  margin-top: 8px;
}

.edit-qty-form,
.edit-decide {
  display: flex;
  gap: 8px;
  align-items: center;
}

.edit-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 16px 0 8px;
}

.edit-decision {
  padding: 14px 16px;
  margin-bottom: 8px;
  border-color: var(--warning);
  background: var(--pack-incomplete-bg);
}

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

.edit-decision-head .receive-chip {
  margin-top: 0;
}

.edit-decision-title {
  font-size: 14px;
  font-weight: 600;
}

.edit-decision-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.edit-decision-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.edit-line-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.edit-add {
  padding: 14px 16px;
  margin-top: 16px;
}

.edit-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.edit-add-qty {
  width: 88px;
}

.receive-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.receive-chip--short {
  color: var(--warning-text);
  border: 1px solid var(--warning);
}
.receive-chip--exact {
  color: var(--success);
  border: 1px solid var(--success);
}
.receive-chip--over {
  color: var(--danger);
  border: 1px solid var(--danger);
}
.receive-chip--blind {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.receive-line-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

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

.receive-lot-row .form-control,
.receive-lot-row .form-select {
  min-width: 120px;
  flex: 1;
}
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.receive-lot-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.receive-add-lot {
  margin-top: 6px;
}

.batch-expiry-banner {
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--warning);
  color: var(--text);
}

.batch-expiry-banner a {
  color: var(--primary);
  font-weight: 600;
}

.batch-status-expired {
  background: var(--danger);
  color: var(--primary-fg);
}

.batch-status-expiring {
  background: var(--warning);
  color: var(--warning-fg);
}

.batch-status-ok {
  background: var(--success);
  color: var(--primary-fg);
}

.receive-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.pack-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  position: sticky;
  bottom: 16px;
}

.grn-header-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grn-capture {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grn-capture .pack-scan {
  margin: 8px auto 8px;
}

.grn-post-form {
  display: flex;
  flex-shrink: 0;
}

.grn-post-submit {
  height: 48px;
  padding: 0 18px;
  font-weight: 600;
}

.grn-scan-status {
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
}

.grn-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.grn-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.grn-summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.grn-summary-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.grn-expiry {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1 1 12rem;
  min-width: 0;
}

.grn-expiry .form-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  font-size: 13.5px;
}

.grn-line-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grn-empty {
  padding: 32px 16px;
}

@media (max-width: 1100px) {
  .grn-header-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.history-session + .history-session {
  margin-top: 12px;
}

.history-session-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.btn {
  border-radius: var(--radius);
  box-shadow: none !important;
}

body .form-control,
body .form-select {
  border-radius: var(--radius);
  font-size: 13.5px;
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

body .form-control:focus,
body .form-select:focus {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: none;
}

body .form-control:disabled,
body .form-control[readonly],
body .form-select:disabled {
  background-color: var(--table-header-bg);
  color: var(--text-muted);
  border-color: var(--border);
  opacity: 1;
}

body .form-check-input {
  background-color: var(--surface);
  border-color: var(--border);
}

body .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.input-group-text {
  background: var(--table-header-bg);
  color: var(--text-muted);
  border-color: var(--border);
}

.form-select option {
  background: var(--surface);
  color: var(--text);
}

.product-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--table-header-bg);
  flex-shrink: 0;
}

.products-toolbar {
  padding: 12px;
  margin-bottom: 12px;
}

.products-toolbar .filter-bar {
  margin-bottom: 0;
  flex-wrap: wrap;
}

.products-toolbar .input-group.filter-search {
  width: 280px;
  height: auto;
}

.products-toolbar .input-group-text,
.products-toolbar .input-group .form-control {
  height: 32px;
}

.products-toolbar + .products-toolbar {
  margin-top: -4px;
}

.products-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--table-header-bg);
}

.products-table .col-check {
  width: 40px;
  text-align: center;
}

.products-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 88px;
}

.products-table .col-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.products-table td.product-identity-cell {
  white-space: normal;
}

.product-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.product-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-identity-sku {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.product-identity-sku:hover {
  color: var(--primary);
}

.product-identity-name {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.product-identity-chips {
  display: inline-flex;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.product-row-low td {
  background: var(--row-low-bg);
  box-shadow: inset 3px 0 0 var(--row-low-border);
}

.product-row-oos td {
  background: var(--row-oos-bg);
  box-shadow: inset 3px 0 0 var(--row-oos-border);
}

.products-table tbody tr.product-row-low:hover td {
  background: var(--row-low-bg);
}

.products-table tbody tr.product-row-oos:hover td {
  background: var(--row-oos-bg);
}

.product-detail-back {
  margin-bottom: 12px;
}

.product-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 16px;
}

.product-hero-frame {
  box-sizing: border-box;
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--table-header-bg);
}

.product-hero-frame img,
.product-hero-image {
  box-sizing: border-box;
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  object-fit: contain;
  display: block;
}

.product-detail-image {
  width: 100%;
  max-width: 240px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--table-header-bg);
}

.product-hero-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.product-hero-name {
  margin: 0 0 6px;
  font-size: 14px;
}

.product-hero-brand {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.product-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.product-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}

.product-tabs .nav-item {
  width: auto;
  height: auto;
  padding: 0;
}

.product-tabs .nav-link {
  color: var(--text-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 13.5px;
  border-radius: 0;
  padding: 8px 14px;
}

.product-tabs .nav-link:hover {
  color: var(--text);
  border-color: transparent;
  background: var(--table-header-bg);
}

.product-tabs .nav-link.active {
  color: var(--primary);
  background: transparent;
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.product-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.col-md-8 > .product-section-title:not(:first-child) {
  margin-top: 16px;
}

.product-barcode-card {
  padding: 16px;
}

.product-barcode-card .product-section-title {
  margin: 0 0 8px;
}

.product-barcode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-barcode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.product-barcode-card .product-barcode-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.stock-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.stock-summary-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stock-summary-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.stock-summary-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stock-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stock-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--text);
}

.stock-tile-low {
  background: var(--row-low-bg);
  box-shadow: inset 3px 0 0 var(--row-low-border);
}

.stock-tile-oos {
  background: var(--row-oos-bg);
  box-shadow: inset 3px 0 0 var(--row-oos-border);
}

.stock-tile-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stock-tile-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.report-tabs .nav-link {
  font-size: 13.5px;
}

.waiting-cover {
  color: var(--text-muted);
}

.age-fresh,
.dispatch-table .col-date.age-fresh {
  color: var(--text-muted);
}

.age-amber,
.dispatch-table .col-date.age-amber {
  color: var(--warning);
  font-weight: 600;
}

.age-red,
.dispatch-table .col-date.age-red {
  color: var(--danger);
  font-weight: 600;
}

.by-user-card {
  padding: 14px 16px;
  margin-bottom: 8px;
}

.by-user-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.by-user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.by-user-initials {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--table-header-bg);
  color: var(--primary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.by-user-name {
  font-size: 14px;
  font-weight: 600;
}

.by-user-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
}

.by-user-days {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.theme-preset {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
}

.theme-preset.selected {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

.theme-swatch {
  display: block;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.theme-preset-name {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.theme-preset[data-theme="dark"] .theme-swatch {
  background: linear-gradient(to right, #0b0d12 0 40%, #161a22 40% 75%, #0d6efd 75% 100%);
}
.theme-preset[data-theme="light"] .theme-swatch {
  background: linear-gradient(to right, #12141c 0 40%, #ffffff 40% 75%, #0d6efd 75% 100%);
}
.theme-preset[data-theme="graphite"] .theme-swatch {
  background: linear-gradient(to right, #2b2f36 0 40%, #1f2329 40% 75%, #e5e7eb 75% 100%);
}
.theme-preset[data-theme="emerald-dark"] .theme-swatch {
  background: linear-gradient(to right, #06140d 0 40%, #0d2418 40% 75%, #22c55e 75% 100%);
}
.theme-preset[data-theme="warm-light"] .theme-swatch {
  background: linear-gradient(to right, #3d2a24 0 40%, #fffaf5 40% 75%, #c2410c 75% 100%);
}
.theme-preset[data-theme="ocean"] .theme-swatch {
  background: linear-gradient(to right, #061525 0 40%, #0b2438 40% 75%, #22d3ee 75% 100%);
}
.theme-preset[data-theme="rose"] .theme-swatch {
  background: linear-gradient(to right, #2a0f1c 0 40%, #3d1728 40% 75%, #ec4899 75% 100%);
}
.theme-preset[data-theme="high-contrast"] .theme-swatch {
  background: linear-gradient(to right, #000000 0 40%, #0a0a0a 40% 75%, #facc15 75% 100%);
}
.theme-preset[data-theme="sand"] .theme-swatch {
  background: linear-gradient(to right, #4a3728 0 40%, #fbf6ef 40% 75%, #8b5e34 75% 100%);
}
.theme-preset[data-theme="slate"] .theme-swatch {
  background: linear-gradient(to right, #1e293b 0 40%, #ffffff 40% 75%, #4f46e5 75% 100%);
}
.theme-preset[data-theme="forest"] .theme-swatch {
  background: linear-gradient(to right, #142015 0 40%, #1d2e1f 40% 75%, #84cc16 75% 100%);
}
.theme-preset[data-theme="sunset"] .theme-swatch {
  background: linear-gradient(to right, #4a1f1a 0 40%, #fff8f4 40% 75%, #f97316 75% 100%);
}
.theme-preset[data-theme="midnight"] .theme-swatch {
  background: linear-gradient(to right, #070b1a 0 40%, #10183a 40% 75%, #eab308 75% 100%);
}
.theme-preset[data-theme="lavender"] .theme-swatch {
  background: linear-gradient(to right, #3b2a55 0 40%, #fcf9ff 40% 75%, #7c3aed 75% 100%);
}
.theme-preset[data-theme="copper"] .theme-swatch {
  background: linear-gradient(to right, #1c120c 0 40%, #2a1b12 40% 75%, #d97706 75% 100%);
}
.theme-preset[data-theme="ice"] .theme-swatch {
  background: linear-gradient(to right, #1b3a4a 0 40%, #f7fbfc 40% 75%, #0ea5e9 75% 100%);
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-weight: 600;
  line-height: 1.2;
}

.user-email {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.user-meta {
  color: var(--text-muted);
}

.user-table .role-badge {
  margin-left: 0;
}

.user-table td {
  white-space: nowrap;
}

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

.user-actions form {
  margin: 0;
}

.user-actions .btn {
  height: 28px;
  font-size: 12.5px;
  padding: 0 10px;
}

.status-badge.user-inactive {
  background: var(--table-header-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.user-dialog,
.phoera-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.user-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: var(--sidebar-bg);
  opacity: 0.55;
}

.user-dialog-card,
.phoera-dialog-card {
  position: relative;
  z-index: 1;
  width: 420px;
  max-width: 100%;
  padding: 16px;
  overflow: visible;
}

.phoera-dialog-card {
  width: 840px;
  max-width: calc(100vw - 48px);
  overflow: hidden;
}

.receiving-dialog-card {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 720px);
  overflow: visible;
}

.receiving-dialog-body {
  min-height: 0;
  max-height: calc(min(80vh, 720px) - 48px);
  overflow: auto;
}

.receiving-dialog-body .user-dialog {
  z-index: 210;
}

.product-dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 16px;
}

.product-dialog-grid .form-label {
  display: block;
}

.product-dialog-grid .form-control,
.product-dialog-grid .form-select {
  width: 100%;
}

.product-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.product-dialog-footer .form-check {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .product-dialog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.user-dialog-card .edit-section-title {
  margin-top: 0;
}

.user-dialog-card .form-label {
  font-size: 13px;
  margin-bottom: 4px;
}

.user-dialog-card .form-control,
.user-dialog-card .form-select {
  font-size: 13.5px;
  border-radius: var(--radius);
}

.user-dialog-card .errorlist {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--danger);
  font-size: 12.5px;
}

.user-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-outline-danger.phoera-outline {
  height: 30px;
  font-size: 13px;
  border-radius: var(--radius);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
}

.edit-order-dialog {
  max-width: 520px;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
}
.edit-order-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.edit-line-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}
.edit-line-card--plus {
  border-style: dashed;
}
.edit-line-card-name {
  font-weight: 600;
  font-size: 13.5px;
}
.edit-line-card-sku {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.edit-line-card-row,
.edit-line-removed {
  display: flex;
  align-items: center;
  gap: 8px;
}
.edit-line-qty {
  width: 72px;
}
.edit-suggest {
  margin-top: 8px;
}
.edit-suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.edit-suggest-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: var(--surface);
  padding: 8px 10px;
  text-align: left;
}
.edit-suggest-item:hover {
  background: var(--table-header-bg);
}
.edit-suggest-name {
  font-size: 13px;
}
.edit-suggest-sku,
.edit-suggest-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.returns-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.returns-header {
  align-items: flex-start;
  margin-bottom: 16px;
}

.returns-header-copy {
  min-width: 0;
}

.returns-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.returns-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* Match Dispatch filter-bar primary (Create manual order) */
#new-return-btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  box-shadow: none;
}

#new-return-btn i {
  font-size: 14px;
  line-height: 1;
}

.returns-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.returns-history {
  /* Match movements/customers: scroll container, not forced X-bar from wide cols */
  overflow: auto;
  overscroll-behavior: contain;
}

.returns-table {
  width: 100%;
  table-layout: fixed;
}

/* Override dispatch-table fixed widths that force horizontal overflow at ~1280 */
.returns-table .col-date {
  width: 7.5rem;
  white-space: nowrap;
}

.returns-table .col-status {
  width: 5.75rem;
}

.returns-table .col-items {
  width: 3.25rem;
}

.returns-table th:nth-child(2),
.returns-table td:nth-child(2) {
  width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.returns-table th:nth-child(5),
.returns-table td:nth-child(5),
.returns-table th:nth-child(6),
.returns-table td:nth-child(6),
.returns-table th:nth-child(7),
.returns-table td:nth-child(7) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.returns-table .col-note {
  width: 22%;
  min-width: 8rem;
  max-width: none;
}

.returns-note-text {
  display: block;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  font-size: 12.5px;
  color: var(--text-muted);
}

.returns-dialog .user-dialog-backdrop {
  cursor: pointer;
}

.returns-dialog-card {
  width: min(980px, calc(100vw - 48px));
  max-height: min(85vh, 720px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.returns-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.returns-dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.returns-dialog-lede {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.returns-dialog-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
}

.returns-dialog-close:hover,
.returns-dialog-close:focus-visible {
  color: var(--text);
  background: var(--table-header-bg);
}

.returns-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 16px;
  position: relative;
  z-index: 1;
  flex: 1;
}

.returns-dialog-card:has(.edit-suggest:not(:empty)) .returns-dialog-body {
  overflow: visible;
}

.returns-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--table-header-bg);
  flex-shrink: 0;
  position: relative;
  z-index: 0;
}

.returns-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.returns-compose {
  max-width: none;
}

.returns-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.returns-mode-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  box-shadow: none;
  white-space: nowrap;
}

.returns-mode-btn.is-active {
  background: var(--primary);
  color: var(--primary-fg);
}

.returns-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: start;
}

.returns-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.returns-field .form-label {
  margin-bottom: 0;
  line-height: 1.2;
}

.returns-field .form-control,
.returns-field .form-select {
  height: 32px;
  min-height: 32px;
}

.returns-field-product,
.returns-field-note {
  grid-column: 1 / -1;
}

.returns-field-qty {
  max-width: 96px;
}

.returns-field-product {
  position: relative;
}

.returns-field-product .edit-suggest {
  position: absolute;
  top: calc(1.2em + 4px + 32px);
  left: 0;
  right: 0;
  z-index: 5;
  margin-top: 0;
}

.returns-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.returns-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.returns-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  line-height: 1;
  flex-shrink: 0;
}

.returns-chip-clear:hover {
  background: var(--table-header-bg);
  color: var(--text);
}

.returns-order-lines {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.returns-order-meta {
  font-size: 13px;
  margin-bottom: 2px;
}

.returns-line {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.returns-line.is-skipped {
  background: color-mix(in srgb, var(--table-header-bg) 65%, var(--surface));
}

.returns-line-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}

.returns-line:not(.is-skipped) .returns-line-head {
  margin-bottom: 8px;
}

.returns-line-include {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.returns-line-include input {
  margin: 0;
}

.returns-line-sku {
  font-weight: 700;
  font-size: 13px;
}

.returns-line-name {
  font-size: 13px;
}

.returns-line-counts {
  font-size: 12px;
  margin-left: auto;
}

.returns-line-fields {
  grid-template-columns: 72px minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}

.returns-line-fields .returns-field-note {
  grid-column: 1 / -1;
}

.returns-page .empty-state .btn {
  margin-top: 12px;
  box-shadow: none;
}

/* Legacy aliases kept for any residual markup */
.returns-workbench {
  padding: 16px;
  margin-bottom: 16px;
  overflow: visible;
}
.returns-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.returns-kind {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.returns-kind-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  box-shadow: none;
}
.returns-kind-btn.is-active {
  background: var(--primary);
  color: var(--primary-fg);
}
.returns-selected {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
}
.returns-source {
  margin-top: 0;
}
.returns-manual-fields,
.returns-supplier-fields {
  /* compose grid inherited from .returns-fields */
}

.channel-settings-lead {
  margin: -4px 0 16px;
}

.channel-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.phoera-card.channel-card {
  padding: 24px;
  overflow: visible;
  cursor: default;
  margin-bottom: 48px;
  border-radius: 8px;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 12%, transparent);
}

.channel-settings-stack > .channel-card:last-child {
  margin-bottom: 0;
}

/* Flex gap already spaces cards; keep margin only when gap is ignored. */
@supports (gap: 48px) {
  .phoera-card.channel-card {
    margin-bottom: 0;
  }
}

.channel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.channel-card-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.channel-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.channel-card-icon--shopify {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.channel-card-icon--woocommerce {
  background: color-mix(in srgb, var(--ch-woocommerce) 18%, var(--surface));
  color: var(--ch-woocommerce);
}

.channel-card-icon--b2b {
  background: color-mix(in srgb, var(--ch-b2b) 18%, var(--surface));
  color: var(--ch-b2b);
}

.channel-card-icon--shiprazor {
  background: color-mix(in srgb, var(--ch-shiprazor) 18%, var(--surface));
  color: var(--ch-shiprazor);
}

.channel-card-titles {
  min-width: 0;
  flex: 1;
}

.channel-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.channel-card-blurb {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.channel-connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
}

.channel-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.channel-status-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13.5px;
}

.channel-status-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-status-copy i {
  flex-shrink: 0;
  font-size: 16px;
}

.channel-status-copy strong {
  font-weight: 600;
}

.channel-status-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.channel-status-actions form {
  margin: 0;
}

.channel-action-btn {
  height: 30px;
  font-size: 12.5px;
  border-radius: var(--radius);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.channel-action-btn i {
  font-size: 13px;
}

.channel-action-btn--test {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  color: var(--primary);
}

.channel-action-btn--test:hover,
.channel-action-btn--test:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}

.channel-action-btn--edit {
  background: var(--table-header-bg);
  border-color: var(--border);
  color: var(--text);
}

.channel-action-btn--edit:hover,
.channel-action-btn--edit:focus-visible {
  background: var(--border-subtle);
  border-color: var(--text-muted);
  color: var(--text);
}

.channel-action-btn--disconnect {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
}

.channel-action-btn--disconnect:hover,
.channel-action-btn--disconnect:focus-visible {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--primary-fg);
}

.channel-action-btn:disabled {
  opacity: 0.55;
}

.channel-card-rule {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--border);
  opacity: 1;
}

.channel-extra-label {
  font-weight: 600;
  color: var(--text);
}

.channel-extra-help {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.channel-extra-help code {
  color: var(--danger);
  font-size: 12px;
}

.channel-card-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.channel-card-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.channel-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sync-status-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sync-status-card {
  cursor: default;
  margin-bottom: 0;
}

.sync-status-card-head {
  margin-bottom: 8px;
}

.sync-status-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
}

.sync-status-card .channel-card-icon--shopify {
  background: color-mix(in srgb, var(--ch-shopify) 18%, var(--surface));
  color: var(--ch-shopify);
}

.sync-status-connected-line {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.sync-status-rule {
  margin: 14px 0 16px;
}

.sync-status-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}

.sync-status-metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}

.sync-status-metric-value {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}

.sync-metric-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-transform: lowercase;
}

.sync-metric-pill--success {
  background: var(--success);
  color: #fff;
}

.sync-metric-pill--error {
  background: var(--danger);
  color: #fff;
}

.sync-metric-pill--running {
  background: var(--warning);
  color: var(--warning-fg);
}

.sync-metric-pill--idle {
  background: var(--table-header-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.sync-status-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-group);
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-fg);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.sync-status-info i {
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 14px;
}

.sync-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sync-status-actions form {
  margin: 0;
}

.sync-action-btn {
  height: 32px;
  font-size: 12.5px;
  border-radius: var(--radius);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: none;
  white-space: nowrap;
}

.sync-action-btn i {
  font-size: 13px;
}

.sync-action-btn--edit {
  background: var(--table-header-bg);
  border-color: var(--border);
  color: var(--text);
}

.sync-action-btn--edit:hover,
.sync-action-btn--edit:focus-visible {
  background: var(--border-subtle);
  border-color: var(--text-muted);
  color: var(--text);
}

.sync-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sync-run-history-head {
  padding: 12px 14px 0;
}

.sync-run-history-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 720px) {
  .sync-status-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1279px) {
  .phoera-sidebar { width: var(--sidebar-collapsed); }
  .phoera-brand-name, .phoera-brand-url, .phoera-nav .nav-item span, .nav-group-toggle span,
  .nav-sub, .phoera-user-row span, .role-badge, .sidebar-btn span { display: none; }
  .phoera-main { margin-left: var(--sidebar-collapsed); }
  .table-scroll { overflow-x: auto; }
  .pack-header-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #pack-workspace #pack-products,
  #pack-workspace #grn-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.adjustments-page > .adjustments-header {
  min-height: 0;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.adjustments-header-copy {
  min-width: 0;
}

.adjustments-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.adjustments-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.adjustments-page .adjust-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--table-header-bg);
  border: 1px solid var(--border);
}

.adjustments-page .products-toolbar {
  flex-shrink: 0;
}

.adjustments-page .filter-date {
  width: 140px;
}

.adjust-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid currentColor;
}

.adjust-qty-badge.is-plus,
.adjustments-page .adjust-onhand-after.is-plus {
  color: var(--success);
}

.adjust-qty-badge.is-minus,
.adjustments-page .adjust-onhand-after.is-minus {
  color: var(--danger);
}

.adjustments-page tr.is-highlighted {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  animation: adjust-row-highlight 2.4s ease-out forwards;
}

@keyframes adjust-row-highlight {
  0%, 40% { outline-color: var(--primary); }
  100% { outline-color: transparent; }
}

.adjustments-page .adjust-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  max-width: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.adjustments-page .adjust-note.is-long {
  cursor: pointer;
}

.adjustments-page .adjust-note.is-open {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.adjustments-page .empty-state .btn {
  box-shadow: none;
}

.adjust-dialog-card,
.adjust-view-card {
  width: min(760px, calc(100vw - 48px));
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 640px);
}

.adjust-view-card {
  width: min(480px, calc(100vw - 48px));
}

.adjust-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.adjust-dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.adjust-dialog-lede {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.adjust-dialog-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
}

.adjust-dialog-close:hover,
.adjust-dialog-close:focus-visible {
  color: var(--text);
  background: var(--table-header-bg);
}

.adjust-dialog-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.adjust-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 16px;
  position: relative;
  z-index: 1;
}

.adjust-dialog-form:has(.adjust-suggest:not(:empty)) .adjust-dialog-body {
  overflow: visible;
}

.adjust-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--table-header-bg);
  flex-shrink: 0;
  position: relative;
  z-index: 0;
}

.adjust-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.adjust-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adjust-line-card > input[type="hidden"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.adjust-line-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 12px 32px 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--table-header-bg);
  overflow: visible;
}

.adjust-line-index {
  margin-top: 22px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.adjust-lines:has(> .adjust-line-card:only-child) .adjust-line-remove {
  display: none;
}

.adjust-line-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
}

.adjust-line-remove:hover,
.adjust-line-remove:focus-visible {
  color: var(--danger);
}

.adjust-line-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
}

.adjust-field-product,
.adjust-field-note,
.adjust-field-meter,
.adjust-field-qty {
  grid-column: 1 / -1;
}

.adjust-line-card:has(.adjust-suggest:not(:empty)) {
  z-index: 5;
}

.adjust-field .form-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.adjust-optional {
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.8;
}

.adjust-combobox {
  position: relative;
}

.adjust-combobox-field {
  position: relative;
}

.adjust-combobox-field > .bi-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

.adjust-combobox-field .form-control {
  padding-left: 30px;
}

.adjust-combobox .adjust-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin-top: 0;
  max-height: min(240px, 42vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 0;
}

.adjust-combobox .adjust-suggest:empty {
  display: none;
}

.adjust-combobox .adjust-suggest.is-locked {
  display: none !important;
}

.adjust-combobox .edit-suggest-list {
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.adjust-qty-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.adjust-seg {
  display: inline-flex;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  flex: 0 0 auto;
}

.adjust-seg button {
  flex: 0 0 auto;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
}

.adjust-seg button + button {
  border-left: 1px solid var(--border);
}

.adjust-seg button.is-on {
  background: var(--primary);
  color: var(--primary-fg);
}

.adjust-qty-input {
  width: 120px;
  flex: 1 1 120px;
  max-width: 160px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.adjust-stock-meter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.adjust-stock-meter.is-empty {
  color: var(--text-muted);
}

.adjust-stock-meter strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.adjust-onhand-after {
  font-weight: 600;
}

.adjust-large-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.adjust-note-input {
  resize: vertical;
  min-height: 52px;
}

.adjust-add-line {
  margin-top: 0;
}

.adjust-suggest-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.adjust-suggest-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.adjust-suggest-text .edit-suggest-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.adjustments-page .form-control:focus,
.adjustments-page .form-select:focus,
.adjust-dialog-card .form-control:focus,
.adjust-dialog-card .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary) 25%, transparent);
}

.adjust-view-dl {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
}

.adjust-view-dl > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.adjust-view-dl dt {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.adjust-view-dl dd {
  margin: 0;
  font-size: 13.5px;
}

@media (max-width: 700px) {
  .adjust-line-grid {
    grid-template-columns: 1fr;
  }

  .adjust-field-product,
  .adjust-field-note,
  .adjust-field-meter,
  .adjust-field-qty {
    grid-column: auto;
  }
}

/* Movements P0 — parity with Adjustments polish */
.movements-page .filter-date {
  width: 140px;
}

.movements-page .products-toolbar {
  flex-shrink: 0;
}

.movements-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.movements-table-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.movements-table-card.table-scroll {
  overflow: auto;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
}

.filter-chip:hover {
  background: var(--table-header-bg);
  color: var(--text);
}

.filter-chip i {
  font-size: 12px;
  color: var(--text-muted);
}

.filter-chip-clear {
  color: var(--primary);
  border-color: var(--primary);
}

.table-footer {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
}

/* Customers v1 */
.status-badge.b2b {
  background: color-mix(in srgb, #6366f1 16%, transparent);
  color: #4f46e5;
  border: 1px solid color-mix(in srgb, #6366f1 28%, transparent);
}

.customers-page .products-toolbar {
  flex-shrink: 0;
}

.customers-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.customers-table-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customers-table-card.table-scroll {
  overflow: auto;
  overscroll-behavior: contain;
}

/* Full-page detail: page chrome fixed; orders table scrolls */
.customers-detail-back {
  flex-shrink: 0;
  margin-bottom: 0;
}

.customers-detail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.customers-detail-v3 .customer-hero,
.customers-detail-v3 .customer-detail-grid {
  flex-shrink: 0;
}

.customers-detail-v3 .customer-detail-orders {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  margin: 0;
}

.customers-orders-table-card {
  flex: 1;
  min-height: 8rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.customer-name-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.customer-name-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.customers-detail-page .customer-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.customer-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.customer-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.customer-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.customer-hero-stats .stock-tile {
  min-width: 120px;
}

.customer-spent {
  font-size: 1rem;
}

.customer-side-card {
  margin-bottom: 12px;
}

.customer-dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 12px;
  margin: 0;
}

.customer-dl dt {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12.5px;
}

.customer-dl dd {
  margin: 0;
  word-break: break-word;
}

.customer-address {
  margin: 0;
  font-style: normal;
  line-height: 1.45;
}

.customer-notes {
  resize: vertical;
  min-height: 96px;
}

.customer-notes-readonly {
  white-space: pre-wrap;
  margin: 0;
}

.customer-order-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.customers-page .empty-state .btn,
.customers-detail-page .empty-state .btn {
  margin-top: 12px;
}


/* Customers v2 dialogs */
.customer-dialog {
  z-index: 200;
}

.order-dialog {
  z-index: 220;
}

.customer-dialog-card {
  width: min(1040px, calc(100vw - 48px));
  max-height: min(88vh, 820px);
}

.order-dialog-card {
  width: min(920px, calc(100vw - 48px));
  max-height: min(88vh, 780px);
}

.customer-dialog-body,
.order-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-dialog-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 12px 16px;
}

@media (max-width: 900px) {
  .customer-dialog-grid {
    grid-template-columns: 1fr;
  }
}

.customer-dialog-section-title {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.customer-dialog-dl {
  grid-template-columns: 88px 1fr;
}

.customer-dialog-orders-scroll,
.order-dialog-lines-scroll {
  max-height: min(280px, 36vh);
  overflow: auto;
}

.customer-order-row {
  cursor: pointer;
}

.customer-order-row:hover {
  background: var(--table-header-bg);
}

.customer-order-open {
  font-weight: 600;
  color: var(--primary);
}

.order-dialog-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

@media (max-width: 720px) {
  .order-dialog-addresses {
    grid-template-columns: 1fr;
  }
}

.order-dialog-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.order-totals-dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.order-totals-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-totals-dl dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.order-totals-dl dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.order-totals-grand {
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.order-dialog-links {
  flex-wrap: wrap;
}


/* Customers v3 — list identity + full-page CRM record */
.status-badge.retail {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
  border: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent);
}

.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--table-header-bg);
  color: var(--primary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.customer-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.customer-identity-cell {
  white-space: normal;
  min-width: 220px;
}

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

.customer-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.customer-identity-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.customer-email-link,
.customer-phone-link {
  color: var(--text-muted);
  text-decoration: none;
}

.customer-email-link:hover,
.customer-phone-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.customers-table .customer-row:hover td {
  background: var(--table-header-bg);
}

.customers-table .customer-metric,
.customers-table .customer-spent-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.customers-table .col-actions {
  width: 1%;
  white-space: nowrap;
}

.customer-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .customer-action-label {
    display: none;
  }
}

.customers-filter-bar .filter-search {
  min-width: min(280px, 100%);
}

.customers-empty-state {
  padding: 28px 16px;
}

.customers-detail-v3 {
  /* shell: products-page provides flex column + viewport lock */
  gap: 12px;
}

.customers-detail-v3 .customer-hero {
  margin-bottom: 0;
}

.customer-hero-identity {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.customer-hero-lede {
  margin: 0 0 8px;
}

.customer-hero-stat-date {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.customers-detail-v3 .customer-detail-grid {
  margin: 0;
}

.customer-detail-section {
  padding: 14px 16px;
  min-width: 0;
}

.customer-detail-notes #customer-notes-block {
  margin: 0;
}

.customers-detail-v3 .customers-orders-table .status-badge + .status-badge {
  margin-left: 4px;
}

.customers-detail-v3 .customer-order-actions {
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .customers-detail-v3 .customer-hero {
    flex-direction: column;
  }

  .customers-detail-v3 .customer-hero-stats {
    width: 100%;
  }

  .customers-detail-v3 .customer-hero-stats .stock-tile {
    flex: 1;
    min-width: 0;
  }
}


/* Customers v4 — CRM record: activity + profile sidebar */
.customers-detail-v4 {
  gap: 12px;
}

.customers-detail-v4 .customers-detail-body {
  gap: 12px;
}

.customers-detail-v4 .customer-hero,
.customers-detail-v4 .customer-record {
  flex-shrink: 0;
}

.customer-hero-v4 {
  padding: 14px 16px;
  margin-bottom: 0;
  align-items: center;
}

.customer-hero-v4 .customer-hero-title {
  font-size: 1.35rem;
  margin: 0 0 4px;
  line-height: 1.25;
}

.customer-hero-v4 .customer-hero-lede {
  margin: 0 0 6px;
  font-size: 13px;
}

.customer-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-hero-chip:hover {
  color: var(--primary);
  text-decoration: underline;
}

.customer-hero-chip i {
  font-size: 12px;
  flex-shrink: 0;
}

.customer-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: min(420px, 100%);
}

.customer-kpi {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--table-header-bg);
  padding: 8px 10px;
  min-width: 0;
}

.customer-kpi-spend {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}

.customer-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.customer-kpi-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

.customer-kpi-spend .customer-kpi-value {
  color: var(--primary);
  font-size: 1.12rem;
}

.customer-kpi-date {
  font-size: 0.92rem;
  font-weight: 650;
}

.customer-record {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  overflow: hidden;
  align-items: stretch;
}

.customer-activity-panel,
.customer-profile-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.customer-activity-panel {
  flex: 1;
}

.customer-profile-panel {
  overflow: auto;
  overscroll-behavior: contain;
}

.customer-panel-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}

.customer-panel-title-inline {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  margin: 0;
}

.customer-activity-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 14px 0;
  flex-shrink: 0;
}

.customer-activity-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-group);
  background: var(--table-header-bg);
}

.customer-activity-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.customer-activity-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.customer-activity-tab.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-subtle);
  font-weight: 650;
}

.customer-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0 5px;
  height: 1.25rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
}

.customer-activity-tab.active .customer-tab-count {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
}

.customer-activity-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.customers-detail-v4 .customers-orders-table-card {
  flex: 1;
  min-height: 8rem;
  margin: 0;
}

.customers-detail-v4 .customer-detail-invoices {
  margin: 0;
}

.customer-profile-panel > .customer-panel-title {
  padding: 12px 14px 4px;
  flex-shrink: 0;
}

.customer-profile-block {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border-subtle);
}

.customer-profile-panel > .customer-profile-block:first-of-type {
  border-top: 0;
  padding-top: 6px;
}

.customer-profile-block .customer-dialog-section-title {
  margin-bottom: 6px;
}

.customer-detail-notes #customer-notes-block {
  margin: 0;
  padding: 0;
  border: 0;
}

.customers-detail-v4 .customer-notes {
  min-height: 88px;
  font-size: 13px;
}

.customers-detail-v4 .customer-order-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.customers-detail-v4 .customer-order-status .status-badge {
  margin: 0;
}

.customers-detail-v4 .customer-order-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.customers-detail-v4 .customers-orders-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}

.customers-detail-v4 .customer-order-actions .btn {
  margin: 0;
  flex: 0 0 auto;
}

.customer-dialog-v4 .customer-order-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.customer-dialog-v4 .customer-order-status .status-badge {
  margin: 0;
}

.customer-dialog-v4 .customer-order-actions {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0;
  white-space: nowrap;
}

.customer-dialog-v4 .customers-orders-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}

/* Dialog v4 — same activity + profile language */
.customer-dialog-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.customer-dialog-v4 {
  gap: 12px;
}

.customer-dialog-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.35fr);
  gap: 12px 14px;
  min-height: 0;
  align-items: start;
}

.customer-dialog-profile {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.customer-dialog-profile > .customer-dialog-section,
.customer-dialog-profile > #customer-notes-block {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}

.customer-dialog-profile > .customer-dialog-section:first-child,
.customer-dialog-profile > #customer-notes-block:first-child {
  border-top: 0;
}

.customer-dialog-activity {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.customer-dialog-activity-head {
  padding: 10px 12px 0;
}

.customer-dialog-activity .customer-dialog-orders,
.customer-dialog-activity .customer-dialog-invoices {
  padding: 8px 10px 10px;
}

.customer-dialog-card {
  width: min(1120px, calc(100vw - 48px));
}

@media (max-width: 960px) {
  .customer-record {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .customer-activity-panel {
    min-height: 18rem;
  }

  .customer-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }

  .customers-detail-v4 .customer-hero-v4 {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-dialog-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .customer-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
}

/* Dashboard v1 — Overview + Reports */
.dashboard-page,
.reports-page {
  gap: 0;
}

.dashboard-body,
.reports-body {
  gap: 12px;
  overflow: hidden;
}

.dashboard-section {
  flex-shrink: 0;
}

.dashboard-section-head,
.dashboard-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dashboard-card-head--table {
  padding: 10px 12px 0;
  margin-bottom: 4px;
}

.dashboard-section-title,
.dashboard-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}

.dashboard-section-meta,
.dashboard-card-meta {
  font-size: 12px;
}

.dashboard-channel-tiles,
.dashboard-kpi-grid {
  margin-bottom: 0;
}

.dashboard-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

a.dashboard-kpi:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.dashboard-kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dashboard-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--table-header-bg);
  color: var(--text-muted);
  font-size: 13px;
}

.dashboard-kpi--channel {
  box-shadow: inset 3px 0 0 var(--dash-accent, var(--primary));
}

.dashboard-kpi--warn {
  background: var(--row-low-bg);
  box-shadow: inset 3px 0 0 var(--row-low-border);
}

.dashboard-kpi--warn .dashboard-kpi-icon {
  background: color-mix(in srgb, var(--row-low-border) 16%, transparent);
  color: var(--warning-text);
}

.dashboard-kpi--danger {
  background: var(--row-oos-bg);
  box-shadow: inset 3px 0 0 var(--row-oos-border);
}

.dashboard-kpi--danger .dashboard-kpi-icon {
  background: color-mix(in srgb, var(--row-oos-border) 14%, transparent);
  color: var(--danger);
}

.dashboard-kpi-hint {
  font-size: 11.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-expiry-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.dashboard-expiry-banner-icon {
  color: var(--warning-text);
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
}

.dashboard-expiry-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.85fr);
  gap: 12px;
}

.dashboard-chart-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 10px;
  overflow: hidden;
}

.dashboard-chart-wrap {
  flex: 1;
  min-height: 160px;
  position: relative;
}

.dashboard-outstanding-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard-outstanding-table .col-qty {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dashboard-empty {
  padding: 24px 12px;
}

.dashboard-empty i {
  font-size: 22px;
  color: var(--success);
}

/* Reports */
.reports-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.reports-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-group);
  background: var(--table-header-bg);
}

.reports-tab {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.reports-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.reports-tab.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.reports-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.reports-period-form {
  margin: 0;
  gap: 0;
}

.reports-period-form .filter-select {
  width: auto;
  min-width: 110px;
}

.reports-csv-btn {
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: none;
}

.reports-csv-btn i {
  font-size: 13px;
}

.reports-summary {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reports-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.reports-summary-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.reports-summary-value {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.reports-table-card {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.reports-table .cell-ellipsis {
  max-width: 320px;
}

.reports-dead-badge {
  background: color-mix(in srgb, var(--warning) 28%, transparent);
  color: var(--warning-text);
}

.variance-pos {
  color: var(--success);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.variance-neg {
  color: var(--danger);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.reports-page .empty-state {
  padding: 28px 16px;
}

.reports-page .empty-state .btn {
  /* no primary CTAs inside empty states */
  display: none;
}

@media (max-width: 1100px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap {
    min-height: 180px;
  }

  .dashboard-outstanding-card {
    max-height: 280px;
  }
}

@media (max-width: 700px) {
  .dashboard-body,
  .reports-body {
    overflow: auto;
    overscroll-behavior: contain;
  }

  .reports-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .reports-toolbar-actions {
    margin-left: 0;
    justify-content: space-between;
  }

  .reports-tabs {
    width: 100%;
  }
}


/* Shiprazor credentials dialog */
.shiprazor-creds-dialog-card {
  width: min(960px, calc(100vw - 48px));
  max-height: min(90vh, 920px);
  overflow: auto;
  padding: 20px;
}

.shiprazor-facade-panel .alert {
  margin-bottom: 16px;
}

.shiprazor-facade-shared .form-label {
  font-weight: 600;
}

.shiprazor-facade-hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shiprazor-copy-hint {
  word-break: break-all;
}

.shiprazor-unreachable-alert code {
  word-break: break-all;
}

.shiprazor-facade-panel .font-monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.shiprazor-creds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.shiprazor-creds-path {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: color-mix(in srgb, var(--table-header-bg) 55%, var(--surface));
  min-width: 0;
}

.shiprazor-creds-path-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.shiprazor-paste-labels {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--border);
}

.shiprazor-paste-labels > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.shiprazor-paste-labels dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.shiprazor-paste-labels dd {
  margin: 0;
  min-width: 0;
}

.shiprazor-key-list li:last-child {
  border-bottom: 0 !important;
}

@media (max-width: 800px) {
  .shiprazor-creds-grid {
    grid-template-columns: 1fr;
  }

  .shiprazor-paste-labels > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
