/* Pardzworld Corporate Admin ? HTML/CSS/JS */

:root {
  --brand: #d94a0a;
  --brand-dark: #b33c08;
  --brand-soft: #fff1ea;
  --ink: #14202b;
  --ink-muted: #5a6b7a;
  --ink-faint: #8a9aab;
  --surface: #f3f6f8;
  --elevated: #ffffff;
  --line: #dce3ea;
  --line-strong: #c5d0db;
  --sidebar: #0f1a24;
  --sidebar-muted: #8fa0b0;
  --success: #1a7a4c;
  --success-soft: #e6f6ee;
  --warning: #b7791f;
  --warning-soft: #fef6e7;
  --danger: #c53030;
  --danger-soft: #fde8e8;
  --info: #1e5f8a;
  --info-soft: #e8f2f9;
  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.05);
  --shadow-md: 0 10px 28px rgba(20, 32, 43, 0.08);
  --radius: 10px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Outfit", "Manrope", sans-serif;
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========== LOGIN ========== */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(217, 74, 10, 0.12), transparent 55%),
    radial-gradient(800px 380px at 100% 100%, rgba(30, 95, 138, 0.1), transparent 50%),
    linear-gradient(160deg, #e9eef2, #f5f7f9 45%, #eef2f5);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(15, 26, 36, 0.92), rgba(15, 26, 36, 0.78)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  display: flex;
  align-items: center;
  padding: 48px;
}

.login-visual-inner {
  max-width: 440px;
  animation: fadeUp 0.55s ease both;
}

.login-brand-mark,
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(145deg, var(--brand), #f07a35);
  box-shadow: 0 10px 24px rgba(217, 74, 10, 0.35);
  color: #fff;
}

/* Brand logo ? auto size / fit */
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.brand-logo--login {
  width: min(180px, 52vw);
  height: auto;
  max-height: 52px;
}

.brand-logo--sidebar {
  width: min(148px, 100%);
  height: auto;
  max-height: 40px;
  flex: 0 1 auto;
}

.login-hero-logo {
  display: block;
  width: min(340px, 100%);
  height: auto;
  max-height: 88px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.login-visual-title {
  margin-top: 28px;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
}

.login-visual-text {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.login-points {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.login-points li {
  position: relative;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.login-form {
  width: min(420px, 100%);
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.5s ease 0.08s both;
}

.login-form-head {
  margin-bottom: 24px;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.login-logo-row .brand-mark {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.login-logo-row strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
}

.login-logo-row span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-form-head h2 {
  font-size: 1.55rem;
}

.login-form-head p {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 74, 10, 0.12);
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 600;
}

.password-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-wrap input {
  flex: 1;
}

.ghost-btn {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
  font-size: 0.85rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
}

.text-link {
  color: var(--brand-dark);
  font-weight: 600;
}

.btn-primary {
  appearance: none;
  border: 0;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 8px 18px rgba(217, 74, 10, 0.28);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
}

.btn-secondary:hover {
  border-color: var(--line-strong);
}

.login-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ========== ADMIN SHELL ========== */
.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 480px at 100% -10%, rgba(217, 74, 10, 0.06), transparent 55%),
    radial-gradient(800px 360px at -5% 15%, rgba(30, 95, 138, 0.05), transparent 50%),
    linear-gradient(180deg, #eef2f5 0%, var(--surface) 40%, #eef1f4 100%);
}

.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #132231 0%, var(--sidebar) 45%, #0c151d 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-brand .brand-logo--sidebar {
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  box-sizing: border-box;
  max-width: 150px;
}

.sidebar-brand .brand-mark {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

@media (max-width: 900px) {
  .brand-logo--sidebar {
    max-width: 120px;
    max-height: 34px;
  }

  .sidebar-brand .brand-text {
    display: none;
  }
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 14px 12px 20px;
}

.nav-group + .nav-group {
  margin-top: 16px;
}

.nav-group-title {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 0 10px 8px;
}

.tree {
  margin-top: 6px;
}

.tree-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
}

.tree-toggle i {
  font-style: normal;
  font-weight: 700;
  width: 12px;
  text-align: center;
}

.tree.open .tree-toggle i {
  display: inline-block;
}

.tree:not(.open) .tree-menu {
  display: none;
}

.tree-menu {
  padding: 0 0 6px 8px;
  display: grid;
  gap: 2px;
}

.nav-ico-txt {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7e0e8;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link.active {
  background: rgba(217, 74, 10, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-ico,
.tree-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  opacity: 0.95;
  color: inherit;
}

.nav-ico svg,
.tree-ico svg,
.icon-btn svg,
.menu-btn svg,
.sidebar-collapse-btn .nav-ico svg,
.logout-btn .nav-ico svg,
.sidebar-expand-fab svg,
.dock-item svg,
.search-field svg {
  width: 18px;
  height: 18px;
  display: block;
}

.tree-toggle {
  gap: 8px;
}

.tree-toggle .tree-label {
  flex: 1;
  min-width: 0;
}

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

.sidebar-footer {
  padding: 14px 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn,
.sidebar-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: #d7e0e8;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.logout-btn:hover,
.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-collapse-btn {
  margin-bottom: 8px;
}

.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.page-sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.menu-btn,
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.menu-btn {
  display: none;
}

.icon-btn {
  position: relative;
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(340px, 34vw);
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-faint);
}

.search-field input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  color: var(--ink);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.user-meta strong {
  font-size: 0.82rem;
}

.user-meta em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.content {
  padding: 22px 24px 36px;
}

.view {
  display: none;
  animation: fadeUp 0.35s ease both;
}

.view.active {
  display: block;
}

.sidebar-backdrop {
  display: none;
}

/* ========== PAGE UI ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.kpi-value {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.kpi-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.kpi-meta .up {
  color: var(--success);
  font-weight: 700;
}

.kpi-meta .warn {
  color: var(--warning);
  font-weight: 700;
}

.kpi-meta .info {
  color: var(--info);
  font-weight: 700;
}

.kpi-meta span:last-child {
  color: var(--ink-faint);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 16px;
}

.panel {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 1rem;
}

.panel-head p {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

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

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.input,
.select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input:focus,
.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 74, 10, 0.12);
}

.table-wrap {
  overflow: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: #f8fafb;
  font-weight: 700;
}

table.data tbody tr {
  transition: background 0.15s ease;
}

table.data tbody tr:hover {
  background: #fafcfd;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.processing,
.badge.confirmed,
.badge.info,
.badge.in-transit,
.badge.open,
.badge.mapped,
.badge.approved,
.badge.draft,
.badge.new {
  background: var(--info-soft);
  color: var(--info);
}

.badge.shipped,
.badge.healthy,
.badge.paid,
.badge.active,
.badge.delivered,
.badge.completed,
.badge.posted,
.badge.arrived,
.badge.live,
.badge.dispatched,
.badge.invoiced,
.badge.assigned,
.badge.on-track,
.badge.done,
.badge.current {
  background: var(--success-soft);
  color: var(--success);
}

.badge.pending,
.badge.low,
.badge.unpaid,
.badge.invited,
.badge.partial,
.badge.low-stock,
.badge.dispatch-plan,
.badge.watch {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.critical,
.badge.delayed,
.badge.overdue,
.badge.inactive,
.badge.out-of-sync,
.badge.sync-error,
.badge.breach-risk {
  background: var(--danger-soft);
  color: var(--danger);
}

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.list-rows {
  padding: 8px 0;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row strong {
  display: block;
  font-size: 0.92rem;
}

.list-row span {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.chart-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  height: 180px;
  padding: 20px 18px 16px;
}

.chart-bars .bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 8px;
}

.chart-bars .bar i {
  display: block;
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #f07a35, var(--brand));
  animation: fadeUp 0.55s ease both;
}

.chart-bars .bar em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 18px;
}

.form-grid .field.full {
  grid-column: 1 / -1;
}

.settings-list {
  padding: 8px 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #c9d3dc;
  border-radius: 999px;
  transition: 0.2s;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + span {
  background: var(--brand);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.empty-note {
  padding: 28px 18px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-grid,
  .split-2 {
    grid-template-columns: 1fr;
  }

  .search-field {
    width: 200px;
  }

  .user-meta {
    display: none;
  }
}

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

  .login-visual {
    min-height: 240px;
    padding: 28px 24px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  .admin-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-btn {
    display: grid;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(10, 16, 22, 0.45);
    z-index: 30;
  }

  .admin-shell.nav-open .sidebar-backdrop {
    display: block;
  }

  .content {
    padding: 18px 16px 28px;
  }

  .topbar {
    padding: 0 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

  .search-field {
    display: none;
  }

  .login-form {
    padding: 24px 18px;
  }
}

/* ========== LIVE-STYLE DASHBOARD TILES ========== */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dash-hero h2 {
  font-size: 1.35rem;
}

.dash-hero p {
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* Branch switcher ? dashboard / analytics / CEO */
.branch-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.branch-switch-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-right: 4px;
}

.branch-chip {
  border: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.branch-chip:hover {
  border-color: #f0b090;
  color: var(--brand-dark);
}

.branch-chip.active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}

.branch-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.branch-sum-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 4px;
}

.branch-sum-card em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.branch-sum-card strong {
  font-family: var(--display), Outfit, sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.branch-sum-card span {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.branch-sum-card.profit {
  background: linear-gradient(145deg, #1a7a4c, #2a9a62);
  border: 0;
  color: #fff;
}

.branch-sum-card.profit em,
.branch-sum-card.profit span {
  color: rgba(255, 255, 255, 0.82);
}

.workflow-pulse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.workflow-pulse div {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.workflow-pulse em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
}

.workflow-pulse strong {
  font-family: var(--display), Outfit, sans-serif;
  font-size: 1.05rem;
}

@media (max-width: 980px) {
  .branch-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.dash-tile {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 16px 14px 14px;
  text-align: left;
  color: #fff;
  min-height: 118px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-tile .dt-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
}

.dash-tile .dt-value {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 10px;
  letter-spacing: -0.03em;
}

.dash-tile .dt-more {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.9;
}

.dash-tile .dt-mark {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  opacity: 0.22;
  font-family: var(--display);
}

.dash-tile.stock { background: linear-gradient(145deg, #1e7a8c, #155e6c); }
.dash-tile.git { background: linear-gradient(145deg, #3d6ea8, #2a4f7a); }
.dash-tile.order { background: linear-gradient(145deg, #d94a0a, #b33c08); }
.dash-tile.plan { background: linear-gradient(145deg, #2f8f5b, #216b43); }
.dash-tile.req { background: linear-gradient(145deg, #6b5b95, #4f4370); }
.dash-tile.reorder { background: linear-gradient(145deg, #c47a1a, #9a5e12); }
.dash-tile.shortage { background: linear-gradient(145deg, #b33a3a, #8c2c2c); }

.dash-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.flow-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 10px;
  text-align: center;
}

.flow-step b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
}

.flow-step span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
}

.flow-step em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ========== ADVANCED ERP UI ========== */
.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kpi.clickable:hover {
  transform: translateY(-2px);
  border-color: #f0b090;
  box-shadow: var(--shadow-md);
}

.kpi .kpi-ico {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.metric-card {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-card h4 {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.metric-card p {
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.progress-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.progress-item label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-item label span:last-child {
  color: var(--ink-muted);
  font-weight: 500;
}

.track {
  height: 8px;
  border-radius: 999px;
  background: #e8eef3;
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #f07a35);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.filters .field {
  margin: 0;
  min-width: 140px;
}

.filters .field.grow {
  flex: 1;
  min-width: 180px;
}

.action-link {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0;
}

.action-link:hover {
  text-decoration: underline;
}

.fs-host {
  position: relative;
}

.fs-host.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #f3f6f8;
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
  padding: 16px 18px 24px;
}

.fs-host.is-fullscreen .panel {
  min-height: 0;
}

.fs-exit-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #132231;
  color: #fff;
  border-radius: 10px;
}

.fs-host.is-fullscreen > .fs-exit-bar {
  display: flex;
}

.fs-exit-bar strong {
  font-size: 0.9rem;
}

.fs-exit-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body.fs-active {
  overflow: hidden;
}

body.page-fs .ai-fab {
  display: none;
}

.fs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 22, 0.45);
  z-index: 70;
}

.fs-overlay.show {
  display: block;
}

.icon-btn.is-on {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ========== BI ANALYTICS ========== */
.bi-shell {
  display: grid;
  gap: 14px;
}

.bi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.bi-toolbar .filters {
  margin: 0;
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

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

.bi-kpi {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

button.bi-kpi.is-link {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}

button.bi-kpi.is-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #9bb3c9;
}

button.bi-kpi.is-link:focus-visible {
  outline: 2px solid #1e5f8a;
  outline-offset: 2px;
}

.bi-kpi .label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bi-kpi .value {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.bi-kpi .delta {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

.bi-kpi .delta.up { color: var(--success); }
.bi-kpi .delta.down { color: var(--danger); }

.bi-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.bi-grid-3 {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
}

.bi-chart {
  padding: 8px 12px 16px;
}

.line-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.donut {
  width: 150px;
  height: 150px;
}

.funnel {
  padding: 14px 16px 18px;
  display: grid;
  gap: 8px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 120px 1fr 52px;
  gap: 10px;
  align-items: center;
}

.funnel-row span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.funnel-row em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.funnel-bar {
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), #f07a35);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 40px;
}

.wh-bars {
  padding: 14px 16px 18px;
  display: grid;
  gap: 12px;
}

@media (max-width: 1100px) {
  .bi-kpis,
  .bi-grid,
  .bi-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .donut-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .bi-kpis,
  .bi-grid,
  .bi-grid-3 {
    grid-template-columns: 1fr;
  }
  .funnel-row {
    grid-template-columns: 1fr;
  }
}

.modal-root {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-root.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 22, 0.5);
}

.modal-sheet {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.28s ease both;
}

.modal-sheet.sm {
  width: min(480px, 100%);
}

.modal-sheet.lg {
  width: min(1100px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-body {
  padding: 16px 18px 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: #fff;
}

.ai-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  height: 52px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(145deg, #1a2a38, #0f1a24);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(15, 26, 36, 0.35);
}

.ai-fab span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  font-size: 0.85rem;
}

.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 94vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
}

.ai-panel.open {
  transform: translateX(0);
}

.ai-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ai-head h3 {
  font-size: 1rem;
}

.ai-head p {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.ai-messages {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(217, 74, 10, 0.06), transparent 60%),
    #f7f9fb;
}

.ai-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.ai-bubble.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
}

.ai-bubble.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 10px;
}

.ai-suggestions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.ai-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ai-compose input {
  flex: 1;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #132231;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 120;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

.tab-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.tab-btn.active {
  background: var(--brand-soft);
  border-color: #f0b090;
  color: var(--brand-dark);
}

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

.detail-grid dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 700;
}

.detail-grid dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.line-items {
  margin-top: 14px;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.stat-pill strong {
  margin-right: 6px;
}

@media (max-width: 1200px) {
  .kpi-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-tiles {
    grid-template-columns: repeat(4, 1fr);
  }

  .dash-flow {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .kpi-grid-6,
  .card-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .dash-tiles,
  .dash-flow {
    grid-template-columns: 1fr 1fr;
  }

  .ai-fab span + em {
    display: none;
  }
}

/* ========== CREATE FORM WIZARD (PO / Invoice) ========== */
.create-flow {
  display: grid;
  gap: 14px;
}

.create-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.create-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.create-step b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2f5;
  color: var(--ink);
  font-size: 0.72rem;
}

.create-step.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.create-step.active b {
  background: var(--brand);
  color: #fff;
}

.create-step.done {
  border-color: #b7e0c8;
  background: var(--success-soft);
  color: var(--success);
}

.grn-summary-page {
  margin-bottom: 14px;
}

/* ========== GRN CREATE FULLSCREEN STUDIO ========== */
.grn-fs-shell.is-fullscreen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(1100px 380px at 8% -8%, rgba(26, 122, 76, 0.08), transparent 55%),
    radial-gradient(900px 320px at 100% 0%, rgba(217, 74, 10, 0.07), transparent 50%),
    #f3f6f8;
  animation: fadeIn 0.28s ease both;
}

.grn-fs-bar {
  display: flex !important;
  flex-shrink: 0;
}

.grn-fs-bar span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #9fb0c3;
  font-weight: 500;
}

.grn-fs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s ease both;
}

.grn-fs-meta .field label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.grn-fs-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  animation: fadeUp 0.4s ease 0.04s both;
}

.grn-kpi {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-height: 72px;
}

.grn-kpi em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.grn-kpi strong {
  font-size: 1.2rem;
  font-family: var(--display), Outfit, sans-serif;
  letter-spacing: -0.02em;
}

.grn-kpi.warn {
  border-color: #f0d4a8;
  background: var(--warning-soft);
}

.grn-kpi.warn em,
.grn-kpi.warn strong {
  color: var(--warning);
}

.grn-kpi.net {
  background: linear-gradient(145deg, #1a7a4c, #2a9a62);
  border: 0;
  color: #fff;
}

.grn-kpi.net em {
  color: rgba(255, 255, 255, 0.82);
}

.grn-fs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex: 0 0 auto;
  min-height: auto;
  animation: fadeUp 0.42s ease 0.08s both;
}

.grn-fs-receive,
.grn-fs-lines {
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
}

.grn-fs-receive {
  overflow: visible;
}

.grn-fs-receive .product-picker,
.grn-fs-receive .erp-add-panel {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  padding: 0 0 12px;
  background: transparent;
}

.grn-fs-receive .add-panel-head {
  padding: 0 14px 10px;
  border: 0;
  background: transparent;
}

.grn-fs-receive .add-panel-head > div:first-child {
  display: none;
}

.grn-fs-receive .add-head-right {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.grn-fs-receive .add-mode-tabs {
  margin: 0;
  flex: 1;
}

.grn-fs-receive .scan-hero {
  margin: 0 14px;
  border-radius: 14px;
  background: #132231;
  color: #fff;
}

.grn-fs-receive .scan-hero .scan-field span {
  color: #9fb0c3;
}

.grn-fs-receive .scan-hero .scan-input {
  background: #fff;
}

.grn-fs-receive .add-pane {
  padding: 0 14px 14px;
}

.grn-fs-receive .stock-pick-grid,
.grn-fs-receive .catalog-grid {
  max-height: min(380px, 42vh);
}

.grn-lines-wrap {
  flex: 1;
  overflow: auto;
  max-height: min(420px, 48vh);
}

.grn-fs-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  margin-top: auto;
}

.grn-foot-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.grn-foot-totals strong {
  color: var(--ink);
  font-family: var(--display), Outfit, sans-serif;
  font-size: 1rem;
  margin-left: 4px;
}

.grn-foot-actions {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
}

@media (max-width: 900px) {
  .grn-fs-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grn-fs-kpis {
    grid-template-columns: 1fr;
  }
  .grn-fs-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .grn-foot-actions {
    justify-content: stretch;
  }
  .grn-foot-actions .btn-primary,
  .grn-foot-actions .btn-secondary {
    flex: 1;
  }
}

.grn-live-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.grn-fs-shell.is-fullscreen .create-main {
  min-height: calc(100vh - 120px);
}

.grn-fs-shell.is-fullscreen .create-top {
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .grn-live-kpis {
    grid-template-columns: 1fr;
  }
}

.create-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.create-layout.stacked {
  grid-template-columns: 1fr;
}

.create-panel {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.create-main {
  width: 100%;
  min-height: auto;
}

.line-editor {
  overflow: visible;
}

.create-panel .panel-head {
  background: linear-gradient(180deg, #fff, #fafbfc);
}

/* Summary sits under full-width create form (PO / GIT / GRN / DC) */
.create-summary {
  position: static;
  width: 100%;
}

.create-summary .sum-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  align-items: stretch;
}

.create-summary .sum-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fb;
  font-size: 0.88rem;
  min-height: 72px;
}

.create-summary .sum-row span {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.create-summary .sum-row strong,
.create-summary .sum-row.sum-total span:last-child {
  color: var(--ink);
  font-size: 1.1rem;
  font-family: var(--display), Outfit, sans-serif;
}

.create-summary .sum-total {
  margin-top: 0;
  padding-top: 12px;
  border: 1px solid #f0b090;
  background: var(--brand-soft);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
}

.create-summary .hint-text {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.create-summary .sum-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.line-editor .data input.input {
  width: 88px;
  height: 34px;
  padding: 0 8px;
}

.line-editor .data td {
  vertical-align: middle;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  font-weight: 700;
}

.logo-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.logo-chip img {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .create-layout {
    grid-template-columns: 1fr;
  }
}

.input.ta {
  height: 72px;
  padding: 10px;
  width: 100%;
  resize: vertical;
}

.hint-text {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.sum-links {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions {
  white-space: nowrap;
  display: flex;
  gap: 8px;
}

.danger-outline {
  color: var(--danger) !important;
  border-color: #f0b4b4 !important;
}

.product-picker {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf7, #fff);
}

.erp-add-panel .add-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.erp-add-panel .add-panel-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.erp-add-panel .add-panel-head p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.add-qty-wrap {
  display: grid;
  gap: 4px;
}

.add-qty-wrap label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.add-qty-wrap .input {
  width: 72px;
}

.quick-sku-row,
.manual-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.quick-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.quick-sku {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.quick-sku:hover {
  border-color: #f0b090;
  background: var(--brand-soft);
}

.quick-sku strong {
  font-size: 0.78rem;
}

.quick-sku span {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.manual-add .input {
  width: 110px;
}

.manual-add .input.grow,
.scan-field.grow {
  flex: 1;
  min-width: 160px;
}

.manual-add .input.grow {
  width: auto;
}

.catalog-drawer {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.catalog-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.catalog-drawer-head strong {
  margin-right: auto;
  font-size: 0.88rem;
}

.catalog-drawer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 10px 12px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  background: #fcfdfe;
}

.catalog-drawer-tools .field {
  margin: 0;
  min-width: 140px;
}

.catalog-drawer-tools .field label {
  font-size: 0.68rem;
}

.catalog-grid,
.stock-pick-drawer .stock-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
}

.catalog-grid.view-card,
.stock-pick-grid.view-card {
  display: grid;
}

.catalog-card,
.stock-catalog-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px 10px;
  background: #fff;
  align-items: start;
}

.catalog-card .pick-thumb,
.stock-catalog-card .pick-thumb {
  grid-row: 1 / span 3;
}

.catalog-card > strong,
.stock-catalog-card > strong {
  font-size: 0.82rem;
}

.catalog-card span,
.stock-catalog-card span {
  font-size: 0.8rem;
  line-height: 1.3;
}

.catalog-card em,
.stock-catalog-card em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.catalog-card-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  gap: 8px;
}

.catalog-card-foot .btn-primary,
.catalog-card-foot .btn-secondary {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 0.76rem;
}

.pick-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.78rem;
  color: hsl(var(--pick-hue, 200) 40% 22%);
  background:
    radial-gradient(circle at 30% 25%, #fff 0%, transparent 45%),
    linear-gradient(145deg, hsl(var(--pick-hue, 200) 55% 90%), hsl(var(--pick-hue, 200) 42% 68%));
  flex-shrink: 0;
}

.prod-hit {
  grid-template-columns: 110px 1fr auto auto;
}

.catalog-card > strong,
.catalog-card > span,
.catalog-card > em,
.stock-catalog-card > strong,
.stock-catalog-card > span,
.stock-catalog-card > em {
  grid-column: 2;
  min-width: 0;
}

.prod-hit .hit-add {
  font-size: 0.72rem;
  color: var(--brand-dark);
}

.empty-lines {
  margin: 0;
  padding: 18px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
  background: #fafbfc;
  border-top: 1px dashed var(--line);
}

.line-count-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 800;
  margin-right: 12px;
}

.process-flow-nav {
  display: none !important;
}

.flow-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-right: 4px;
}

.flow-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.flow-chip.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.flow-chip.ghost {
  border-style: dashed;
}

.flow-arrow {
  color: var(--ink-muted);
  opacity: 0.6;
}

.create-steps .create-step {
  cursor: default;
}

button.create-step {
  cursor: pointer;
  font: inherit;
}

.head-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.api-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.api-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.api-card.active {
  border-color: #f0b090;
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.api-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.api-ep {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ink-muted);
  word-break: break-all;
}

.api-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.scan-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.scan-field {
  display: grid;
  gap: 4px;
  min-width: 160px;
}

.scan-field.grow {
  flex: 1;
  min-width: 200px;
}

.scan-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prod-results {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.prod-results[hidden] {
  display: none !important;
}

.add-pane[hidden] {
  display: none !important;
}

.add-pane.active:not([hidden]) {
  display: block;
}

.prod-hit {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.prod-hit:hover {
  border-color: #f0b090;
  background: var(--brand-soft);
}

.prod-hit strong {
  font-size: 0.82rem;
}

.prod-hit span {
  font-size: 0.84rem;
}

.prod-hit em {
  font-style: normal;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.settings-page .settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.settings-tab.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding-right: 12px;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.line-editor .data input.input {
  width: 88px;
  height: 34px;
  padding: 0 8px;
}

@media (max-width: 700px) {
  .prod-hit {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .scan-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .create-summary {
    position: static;
  }

  .login-hero-logo {
    max-height: 64px;
    width: min(260px, 100%);
  }
}

@media (max-width: 560px) {
  .brand-logo--login {
    max-height: 40px;
    width: min(150px, 70vw);
  }

  .line-editor .data input.input {
    width: 68px;
  }
}

/* ========== SIDEBAR COLLAPSE / FULLSCREEN WORKSPACE ========== */
.admin-shell.sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

.admin-shell.sidebar-collapsed .brand-text,
.admin-shell.sidebar-collapsed .tree-toggle .tree-label,
.admin-shell.sidebar-collapsed .tree-toggle i,
.admin-shell.sidebar-collapsed .nav-label {
  display: none;
}

.admin-shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.admin-shell.sidebar-collapsed .nav-ico {
  width: 22px;
  height: 22px;
}

.admin-shell.sidebar-collapsed .nav-ico svg {
  width: 20px;
  height: 20px;
}

.admin-shell.sidebar-collapsed .tree-toggle {
  justify-content: center;
  padding: 8px;
}

.admin-shell.sidebar-collapsed .tree-menu {
  padding-left: 0;
}

.admin-shell.sidebar-collapsed .brand-logo--sidebar {
  max-width: 48px;
  padding: 4px;
}

.admin-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 14px 8px;
}

.admin-shell.sidebar-collapsed .sidebar-close,
.admin-shell.sidebar-collapsed .brand-text {
  display: none;
}

.admin-shell.sidebar-collapsed .sidebar-footer {
  display: grid;
  gap: 8px;
}

.admin-shell.sidebar-collapsed .sidebar-collapse-btn .nav-label,
.admin-shell.sidebar-collapsed .logout-btn .nav-label {
  display: none;
}

/* True content fullscreen ? hide side menu completely */
.admin-shell.sidebar-hidden {
  grid-template-columns: 1fr;
}

.admin-shell.sidebar-hidden .sidebar {
  display: none;
}

.admin-shell.sidebar-hidden .sidebar-expand-fab {
  display: grid;
}

.sidebar-expand-fab {
  display: none;
  position: fixed;
  left: 12px;
  top: calc(var(--topbar-h) + 18px);
  z-index: 35;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.sidebar-expand-fab:hover {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.desk-collapse {
  display: grid;
}

.page-heading {
  min-width: 0;
}

.home-btn.is-home {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* ERP ribbon ? module tabs under topbar */
.erp-ribbon {
  position: sticky;
  top: var(--topbar-h);
  z-index: 18;
  display: grid;
  gap: 8px;
  padding: 10px 24px 12px;
  background: linear-gradient(180deg, #fff 0%, #f7f9fb 100%);
  border-bottom: 1px solid var(--line);
}

.erp-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.erp-crumb button {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.erp-crumb .sep {
  opacity: 0.45;
}

.erp-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.erp-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.erp-tab svg {
  width: 14px;
  height: 14px;
}

.erp-tab:hover {
  border-color: #f0b090;
  color: var(--brand-dark);
}

.erp-tab.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.mobile-dock {
  display: none;
}

@media (max-width: 900px) {
  .desk-collapse {
    display: none !important;
  }

  .admin-shell.sidebar-collapsed,
  .admin-shell.sidebar-hidden {
    grid-template-columns: 1fr;
  }

  .admin-shell.sidebar-hidden .sidebar {
    display: flex;
  }

  .admin-shell.sidebar-hidden .sidebar-expand-fab {
    display: none;
  }

  .erp-ribbon {
    padding: 8px 14px 10px;
    top: var(--topbar-h);
  }

  .content {
    padding-bottom: 88px;
  }

  .mobile-dock {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(15, 26, 36, 0.06);
  }

  .dock-item {
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    font: inherit;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 6px 1px;
    cursor: pointer;
  }

  .dock-item.active {
    color: var(--brand-dark);
  }

  .ai-fab {
    bottom: 76px;
  }

  .search-field {
    width: min(160px, 28vw);
  }

  .page-sub {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }

  .topbar-left {
    gap: 6px;
  }

  .page-title {
    font-size: 1rem;
  }

  .user-chip .user-meta,
  .search-field {
    display: none;
  }

  .erp-tab span.tab-full {
    display: none;
  }
}

/* ========== AI / REPORT SHARE ========== */
.range-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.range-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.range-pill.active {
  background: var(--brand-soft);
  border-color: #f0b090;
  color: var(--brand-dark);
}

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

.gap-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.gap-card h4 {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.gap-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  font-size: 0.78rem;
}

.gap-meta span {
  background: #f3f6f8;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 600;
}

.ceo-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.ceo-sheet .ceo-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.ceo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

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

.ceo-kpi b {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.ceo-kpi strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 1.15rem;
}

@media print {
  .sidebar, .topbar, .ai-fab, .ai-panel, .share-actions, .bi-toolbar, .menu-btn, .desk-collapse, .sidebar-backdrop, .erp-ribbon, .mobile-dock, .sidebar-expand-fab {
    display: none !important;
  }
  .admin-shell {
    display: block !important;
  }
  .content {
    padding: 0 !important;
  }
  .ceo-sheet {
    border: 0;
  }
  body.print-ceo .create-top,
  body.print-ceo .bi-toolbar,
  body.print-ceo #aiNarrative,
  body.print-ceo .panel,
  body.print-ceo .fs-exit-bar {
    display: none !important;
  }
  body.print-ceo .ceo-sheet {
    box-shadow: none;
    max-width: 100%;
  }
}

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

/* ========== WAREHOUSE DISPATCH FLOW ========== */
.wh-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(90deg, #fff, #f5faf7);
}

.wh-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--ink-muted);
}

.wh-stage-chip em {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef2f5;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
}

.wh-stage-chip strong {
  font-size: 0.82rem;
}

.wh-stage-chip span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.wh-stage-chip.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.wh-stage-chip.ghost {
  border-style: dashed;
}

.wh-pipe-arrow {
  color: var(--ink-muted);
  opacity: 0.55;
}

.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.mode-pill.active {
  border-color: #f0b090;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.wh-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.wh-column {
  background: #f4f7f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  max-height: 620px;
}

.wh-column header {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.wh-cards {
  padding: 10px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.wh-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border-top: 3px solid #c5d0da;
}

.wh-card.mode-marketplace { border-top-color: #d94a0a; }
.wh-card.mode-retail { border-top-color: #1f8a5b; }
.wh-card.mode-wholesale { border-top-color: #2f6fed; }

.wh-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.wh-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.wh-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.78rem;
}

.wh-api {
  font-size: 0.75rem;
}

.wh-empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.wh-work-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 14px;
  align-items: start;
}

.wh-queue {
  display: grid;
  gap: 8px;
  padding: 12px;
  max-height: 640px;
  overflow: auto;
}

.wh-queue-item {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.wh-queue-item.active {
  border-color: #f0b090;
  background: var(--brand-soft);
}

.wh-queue-item span,
.wh-queue-item em {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: normal;
}

.wh-mini-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.wh-mini-steps span {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: #fff;
}

.wh-mini-steps span.done {
  background: var(--success-soft);
  color: var(--success);
  border-color: #b7e0c8;
}

.wh-mini-steps span.on {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: #f0b090;
}

.wh-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wh-info-grid > div {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.wh-info-grid span {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.wh-bench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.wh-bench-actions .field {
  min-width: 160px;
}

.badge.retail,
.badge.wholesale,
.badge.marketplace,
.badge.synced,
.badge.delivered,
.badge.n-a {
  background: var(--success-soft);
  color: var(--success);
}

.badge.marketplace,
.badge.ready-to-push,
.badge.in-transit,
.badge.out-for-delivery,
.badge.order-acknowledged,
.badge.dispatched {
  background: var(--info-soft);
  color: var(--info);
}

.badge.pending,
.badge.pick,
.badge.pack,
.badge.order {
  background: var(--warning-soft);
  color: var(--warning);
}

@media (max-width: 1100px) {
  .wh-work-layout {
    grid-template-columns: 1fr;
  }
  .wh-info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .wh-board {
    grid-template-columns: repeat(5, 220px);
  }
}

/* ========== PROFIT MARGIN REPORT ========== */
.profit-vs-list,
.profit-status-list {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.profit-vs-row,
.profit-status-row {
  display: grid;
  gap: 8px;
}

.pvr-head,
.profit-status-row > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
}

.pvr-head span,
.profit-status-row span {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.pvr-bars {
  display: grid;
  gap: 6px;
}

.pvr-bar {
  position: relative;
  height: 28px;
  border-radius: 8px;
  background: #eef2f5;
  overflow: hidden;
}

.pvr-bar i {
  display: block;
  height: 100%;
  border-radius: 8px;
}

.pvr-bar.sales i {
  background: linear-gradient(90deg, #3d6ea8, #6a93c4);
}

.pvr-bar.profit i {
  background: linear-gradient(90deg, #1f8a5b, #4caf7a);
}

.pvr-bar em {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.profit-status-row .track {
  height: 8px;
  border-radius: 999px;
  background: #eef2f5;
  overflow: hidden;
}

.profit-status-row .track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #f07a35);
}

.profit-status-row em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.margin-good { color: var(--success); }
.margin-ok { color: var(--warning); }
.margin-low { color: var(--danger); }

/* ========== ACCOUNTS (Tally / Zoho) + GST ========== */
.acct-voucher-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px;
  border-radius: 12px;
  background: #1b2838;
}

.acct-vbtn {
  border: 0;
  background: transparent;
  color: #c5d0dc;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.acct-vbtn.active,
.acct-vbtn:hover {
  background: var(--brand);
  color: #fff;
}

.acct-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.84rem;
}

.acct-age-tabs {
  margin-bottom: 12px;
}

.age-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.credit-days {
  display: inline-block;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef4f8;
  color: #1e5f8a;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.age-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.age-chip.age-ok {
  background: #e6f5ec;
  color: #1a7a4c;
}

.age-chip.age-watch {
  background: #fff6e5;
  color: #b7791f;
}

.age-chip.age-warn {
  background: #ffedd5;
  color: #c2410c;
}

.age-chip.age-bad {
  background: #fde8e8;
  color: #c0392b;
}

.age-bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 160px) 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.age-bar-row > span {
  font-weight: 700;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.age-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f5;
}

.age-bar i {
  display: block;
  height: 100%;
}

.age-bar-row em {
  font-style: normal;
  font-weight: 800;
  font-size: 0.78rem;
  min-width: 72px;
  text-align: right;
}

.age-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.age-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.age-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.age-stack {
  border-top: 1px solid var(--line);
}

.ie-trend {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 180px;
  padding: 16px 18px 8px;
}

.ie-col {
  flex: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.ie-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
}

.ie-bars i {
  width: 12px;
  border-radius: 4px 4px 0 0;
  display: block;
  min-height: 2px;
}

.ie-bars i.inc { background: #1a7a4c; }
.ie-bars i.exp { background: #d94a0a; }

.ie-col em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.ie-cats {
  padding: 14px 16px 18px;
  display: grid;
  gap: 8px;
}

.ie-cats h4 {
  margin: 10px 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.ie-cats h4:first-child {
  margin-top: 0;
}

tr.ie-in td:nth-child(5) { color: #1a7a4c; }
tr.ie-out td:nth-child(5) { color: #d94a0a; }

.bi-kpi .delta.pending { color: #b7791f; }

@media (max-width: 720px) {
  .age-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .age-bar-row em {
    text-align: left;
  }
  .ie-trend {
    overflow-x: auto;
  }
  .ie-col {
    min-width: 44px;
  }
}

.acct-gateway {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.acct-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.acct-tile {
  text-align: left;
  border: 1px solid var(--line, #e5eaf0);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.acct-tile:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(217, 74, 10, 0.12);
}

.acct-tile strong { font-size: 0.92rem; }
.acct-tile span { color: var(--ink-muted); font-size: 0.75rem; }
.acct-tile em { font-style: normal; font-size: 0.7rem; font-weight: 800; color: var(--brand); }

.gst-vs-bars {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.gst-vs-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
}

.gst-dual {
  position: relative;
  height: 22px;
  background: #eef2f5;
  border-radius: 8px;
  overflow: hidden;
}

.gst-dual i {
  position: absolute;
  left: 0;
  height: 50%;
}

.gst-dual i.sales {
  top: 0;
  background: linear-gradient(90deg, #3d6ea8, #6a93c4);
}

.gst-dual i.purchase {
  bottom: 0;
  background: linear-gradient(90deg, #b7791f, #d4a017);
}

.gst-vs-row em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.badge.matched { background: var(--success-soft); color: var(--success); }
.badge.mismatch { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.b2b { background: #e8f0fe; color: #1a56db; }
.badge.b2c,
.badge.b2c-others,
.badge.b2c-large { background: #f3e8ff; color: #7e22ce; }

@media (max-width: 980px) {
  .acct-gateway { grid-template-columns: 1fr; }
  .acct-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gst-vs-row { grid-template-columns: 1fr; }
}

/* ========== PRODUCT ADD ? SCAN ? STOCK PICK ========== */
.erp-add-panel {
  margin: 12px 16px;
  padding: 14px;
  border: 1px solid var(--line, #e5eaf0);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf7 0%, #fff 40%);
}

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

.add-panel-head h4 {
  margin: 0;
  font-size: 0.98rem;
}

.add-panel-head p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.add-head-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.add-mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #1b2838;
}

.add-mode {
  border: 0;
  background: transparent;
  color: #c5d0dc;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.add-mode.active,
.add-mode:hover {
  background: var(--brand);
  color: #fff;
}

.add-qty-wrap {
  display: grid;
  gap: 4px;
}

.add-qty-wrap label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.add-qty-wrap .input {
  width: 72px;
}

.scan-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.scan-lens {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--brand);
  position: relative;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}

.scan-lens i {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand);
  animation: scanSweep 1.4s ease-in-out infinite;
}

@keyframes scanSweep {
  0%, 100% { top: 8px; opacity: 0.4; }
  50% { top: 36px; opacity: 1; }
}

.scan-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

.scan-hint {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.erp-add-panel.scan-flash {
  box-shadow: 0 0 0 3px rgba(217, 74, 10, 0.25);
}

.stock-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.stock-pick-drawer .stock-pick-toolbar {
  margin-bottom: 0;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
}

.view-tog {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.view-tog.active {
  background: var(--brand);
  color: #fff;
}

.stock-pick-grid.view-list,
.catalog-grid.view-list {
  display: block;
  padding: 0 8px 12px;
  max-height: 360px;
}

.pick-list-table {
  width: 100%;
}

.stock-pick-grid:not(.catalog-grid) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.stock-catalog-card:hover {
  border-color: #f0b090;
  box-shadow: 0 6px 16px rgba(217, 74, 10, 0.08);
}

.doc-share {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.save-success {
  text-align: center;
  padding: 12px 8px 4px;
}

.save-ok-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-soft);
  color: var(--success);
  font-size: 1.6rem;
  font-weight: 800;
}

.save-success h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.save-ok-msg {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.save-ok-sub {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.doc-pdf-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 12px 0 0;
  padding: 12px;
  background: #f7f9fb;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.catalog-drawer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.stk-badge {
  display: inline-flex;
  min-width: 28px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--success-soft);
  color: var(--success);
}

.stk-badge.stk-low,
.stk-low .stk-badge,
em.stk-low {
  background: var(--danger-soft);
  color: var(--danger);
}

.stk-badge.stk-mid,
.stk-mid .stk-badge,
em.stk-mid {
  background: var(--warning-soft);
  color: var(--warning);
}

.stk-ok { color: var(--success); }
.stk-mid { color: var(--warning); }
.stk-low { color: var(--danger); }

.line-grid .qty-inp {
  width: 78px;
  min-width: 64px;
}

.line-grid .mono,
td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

tr.row-warn td {
  background: #fff7f2;
}

.stock-warn {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.84rem;
  font-weight: 600;
}

.quick-sku em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .scan-hero { flex-direction: column; align-items: stretch; }
  .add-head-right { width: 100%; }
}

/* ========== INVOICE ADD PRODUCT FULLSCREEN ========== */
.inv-fs-shell.is-fullscreen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(1200px 400px at 10% -10%, #fff1ea 0%, transparent 55%),
    #f3f6f8;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.inv-fs-shell.is-fullscreen > .fs-exit-bar,
.inv-fs-shell.is-fullscreen > .inv-fs-flow,
.inv-fs-shell.is-fullscreen > .inv-fs-meta,
.inv-fs-shell.is-fullscreen > .inv-fs-kpis,
.inv-fs-shell.is-fullscreen > .stock-warn {
  flex: 0 0 auto;
}

.inv-fs-bar {
  display: flex !important;
  flex-shrink: 0;
}

.inv-fs-bar span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: #9fb0c3;
  font-weight: 500;
}

.inv-fs-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inv-fs-flow .create-step {
  cursor: default;
}

.inv-fs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line, #e5eaf0);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.inv-fs-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  flex-shrink: 0;
}

.inv-kpi {
  background: #fff;
  border: 1px solid var(--line, #e5eaf0);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.inv-kpi em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-kpi strong {
  font-size: 1.15rem;
  font-family: var(--display), Outfit, sans-serif;
}

.inv-kpi.net {
  background: linear-gradient(145deg, var(--brand), #f07a35);
  border: 0;
  color: #fff;
}

.inv-kpi.net em { color: rgba(255,255,255,0.85); }

.inv-fs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  flex: 0 0 auto;
  min-height: auto;
  width: 100%;
}

.inv-fs-picker,
.inv-fs-cart {
  min-height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  flex-shrink: 0;
}

.inv-fs-picker.panel,
.inv-fs-cart.panel {
  overflow: visible;
}

.inv-fs-picker {
  order: 1;
}

.inv-fs-meta {
  order: 2;
}

.inv-fs-kpis,
.inv-fs-grid > .stock-warn {
  order: 3;
}

.inv-fs-cart {
  order: 4;
}

.inv-fs-tabs {
  margin: 0 14px 12px;
  width: calc(100% - 28px);
  box-sizing: border-box;
  display: inline-flex;
  flex-wrap: wrap;
}

.inv-fs-tabs .add-mode {
  flex: 1;
  text-align: center;
  min-width: 100px;
}

.inv-fs-picker .add-pane {
  padding: 0 14px 16px;
  flex: 0 0 auto;
  overflow: visible;
  min-height: auto;
  display: block;
}

.inv-fs-picker .add-pane[hidden] {
  display: none !important;
}

.inv-fs-picker .add-pane.active:not([hidden]) {
  display: block !important;
}

.inv-scan-hero {
  padding: 16px;
  border-radius: 14px;
  background: #132231;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.inv-scan-hero .scan-field span {
  color: #9fb0c3;
}

.inv-scan-hero .scan-input {
  background: #fff;
}

.inv-stock-grid,
.inv-catalog-grid {
  max-height: min(360px, 40vh);
  min-height: 160px;
  overflow: auto;
}

.inv-fs-shell.is-fullscreen .inv-fs-picker,
.inv-fs-shell.is-fullscreen .inv-fs-cart,
.grn-fs-shell.is-fullscreen .grn-fs-receive,
.grn-fs-shell.is-fullscreen .grn-fs-lines {
  min-height: auto;
  overflow: visible;
}

.inv-cart-foot {
  padding: 14px 16px;
  border-top: 1px solid var(--line, #e5eaf0);
  background: #fafbfc;
  margin-top: 0;
}

.inv-fs-cart.create-summary .sum-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.inv-fs-cart.create-summary .sum-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 72px;
}

.inv-fs-cart.create-summary .sum-row span {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-fs-cart.create-summary .sum-row strong,
.inv-fs-cart.create-summary .sum-row.sum-total span:last-child {
  color: var(--ink);
  font-size: 1.1rem;
  font-family: var(--display), Outfit, sans-serif;
}

.inv-fs-cart.create-summary .sum-total {
  border-color: #f0b090;
  background: var(--brand-soft);
}

.inv-fs-cart.create-summary .sum-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inv-cart-wrap {
  flex: 0 0 auto;
  overflow: auto;
  max-height: min(420px, 45vh);
  min-height: 120px;
}

.inv-empty {
  border: 0;
  background: transparent;
  padding: 24px 16px;
}

/* GRN fullscreen ? same shrink fix */
.grn-fs-shell.is-fullscreen > .fs-exit-bar,
.grn-fs-shell.is-fullscreen > .grn-fs-meta,
.grn-fs-shell.is-fullscreen > .grn-fs-kpis,
.grn-fs-shell.is-fullscreen > .stock-warn {
  flex: 0 0 auto;
}

.grn-fs-meta,
.grn-fs-kpis {
  flex-shrink: 0;
}

.grn-fs-grid {
  flex: 0 0 auto;
  min-height: auto;
}

.grn-fs-receive,
.grn-fs-lines {
  overflow: visible;
  min-height: auto;
}

@media (max-width: 1100px) {
  .inv-fs-grid { grid-template-columns: 1fr; }
  .inv-fs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-fs-picker,
  .inv-fs-cart { min-height: auto; }
  .inv-cart-wrap { max-height: 360px; }
}

@media (max-width: 640px) {
  .inv-fs-kpis { grid-template-columns: 1fr 1fr; }
  .inv-fs-shell.is-fullscreen { padding: 10px 12px 80px; }
}

/* Professional GST invoice print (hidden host) */
#gstPrintHost {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 210mm;
}

@media print {
  body.gst-printing * { visibility: hidden !important; }
  body.gst-printing #gstPrintHost,
  body.gst-printing #gstPrintHost * { visibility: visible !important; }
  body.gst-printing #gstPrintHost {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    background: #fff;
  }
}

.gst-inv-sheet {
  font-family: "Segoe UI", Manrope, sans-serif;
  color: #132;
  font-size: 11px;
  line-height: 1.35;
  padding: 12mm 14mm;
  box-sizing: border-box;
}
.gst-inv-sheet * { box-sizing: border-box; }
.gst-inv-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border-bottom: 2px solid #132;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.gst-inv-brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.gst-inv-brand img { width: 52px; height: 52px; object-fit: contain; }
.gst-inv-brand h1 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.gst-inv-brand p { margin: 2px 0 0; color: #556; font-size: 10px; }
.gst-inv-title {
  text-align: right;
}
.gst-inv-title strong {
  display: block;
  font-size: 20px;
  color: #d94a0a;
  letter-spacing: 0.04em;
}
.gst-inv-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.gst-inv-box {
  border: 1px solid #c9d3dc;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 72px;
}
.gst-inv-box h4 {
  margin: 0 0 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a7a88;
}
.gst-inv-box b { font-size: 12px; }
.gst-inv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}
.gst-inv-table th,
.gst-inv-table td {
  border: 1px solid #c9d3dc;
  padding: 5px 6px;
  text-align: left;
  vertical-align: top;
}
.gst-inv-table th {
  background: #f0f3f6;
  font-size: 9px;
  text-transform: uppercase;
}
.gst-inv-table .num { text-align: right; white-space: nowrap; }
.gst-inv-totals {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  margin-top: 8px;
}
.gst-inv-terms {
  border: 1px solid #c9d3dc;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
}
.gst-inv-terms h4 { margin: 0 0 4px; font-size: 9px; text-transform: uppercase; color: #6a7a88; }
.gst-inv-terms ul { margin: 0; padding-left: 16px; }
.gst-inv-sum table { width: 100%; border-collapse: collapse; }
.gst-inv-sum td { padding: 3px 0; }
.gst-inv-sum td:last-child { text-align: right; font-weight: 700; }
.gst-inv-sum .grand td {
  border-top: 2px solid #132;
  padding-top: 6px;
  font-size: 13px;
}
.gst-inv-sign {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
  text-align: center;
}
.gst-inv-sign .slot {
  border-top: 1px solid #9aa8b5;
  padding-top: 6px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 10px;
  color: #556;
}
.gst-inv-seal {
  width: 64px;
  height: 64px;
  margin: 0 auto 6px;
  border: 2px dashed #c0392b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #c0392b;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transform: rotate(-12deg);
}
.gst-inv-foot {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #c9d3dc;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #6a7a88;
}

/* ========== SMOOTH NAVIGATION ? FLOW RAIL ========== */
#contentRoot.view-leave {
  opacity: 0.35;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

#contentRoot.view-enter {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  animation: viewEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.erp-tab {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.erp-tab:active {
  transform: scale(0.97);
}

.erp-flow-rail {
  margin-top: 4px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  display: block;
}

.erp-flow-rail[hidden] {
  display: none !important;
}

/* Hide flow rail on fullscreen entry workspaces */
body.fs-active .erp-flow-rail {
  display: none !important;
}

.erp-flow-rail.mini .flow-rail-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 36px;
}

.flow-rail-mini-label {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.erp-flow-rail.mini .flow-rail-steps {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: thin;
}

.erp-flow-rail.mini .flow-rail-step {
  border: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  line-height: 1.2;
}

.erp-flow-rail.mini .flow-rail-step b {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e8eef3;
  font-size: 0.6rem;
}

.erp-flow-rail.mini .flow-rail-step.done {
  border-color: #b7e0c8;
  color: #1f8a5b;
}

.erp-flow-rail.mini .flow-rail-step.done b {
  background: #1f8a5b;
  color: #fff;
}

.erp-flow-rail.mini .flow-rail-step.active {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.erp-flow-rail.mini .flow-rail-step.active b {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.flow-rail-next-link {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--brand-dark, #9a3412);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
  white-space: nowrap;
}

.flow-rail-next-link:hover {
  text-decoration: underline;
}

/* Legacy bulky flow UI ? never show on work screens */
.process-flow-nav,
.list-next-banner,
.erp-flow-rail.compact,
.flow-rail-top,
.flow-rail-nav,
.flow-rail-track {
  display: none !important;
}

.list-flow-page {
  display: contents;
}

.flow-nav-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flow-progress-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.flow-progress {
  height: 5px;
  border-radius: 999px;
  background: #eef2f5;
  overflow: hidden;
}

.flow-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #f07a35);
  transition: width 0.35s ease;
}

.flow-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.flow-chip b {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.68rem;
  background: #eef2f5;
  color: var(--ink-muted);
}

.flow-chip.done {
  border-color: #9fe0bc;
  background: var(--success-soft);
  color: var(--success);
}

.flow-chip.done b {
  background: var(--success);
  color: #fff;
}

.flow-chip.active b {
  background: var(--brand);
  color: #fff;
}

.flow-arrow {
  width: 14px;
  height: 2px;
  background: #d5dde5;
  border-radius: 2px;
}

.flow-nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-link,
.tree-toggle {
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.dock-item {
  transition: color 0.2s ease, transform 0.15s ease;
}

.dock-item:active {
  transform: scale(0.94);
}

@media (max-width: 900px) {
  .erp-flow-rail.mini .flow-rail-mini {
    flex-wrap: wrap;
  }
  .flow-rail-next-link {
    margin-left: auto;
  }
}

.list-flow-page {
  display: contents;
}

.list-next-banner {
  display: none !important;
}

.wf-map-grid {
  display: grid;
  gap: 14px;
}

.wf-pack .wf-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 14px 16px 16px;
}

.wf-step-card {
  display: grid;
  gap: 4px;
  min-width: 140px;
  max-width: 180px;
  flex: 1 1 140px;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.wf-step-card:hover {
  border-color: var(--brand, #e85d04);
}

.wf-step-card b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  background: #fff3eb;
  color: var(--brand-dark, #9a3412);
}

.wf-step-card strong {
  font-size: 0.84rem;
}

.wf-step-card span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  word-break: break-all;
}

.wf-pack .flow-arrow {
  align-self: center;
  width: 18px;
  height: 2px;
  background: var(--line);
  flex: 0 0 18px;
}

@media (max-width: 700px) {
  .wf-pack .flow-arrow { display: none; }
}

button.flow-step {
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button.flow-step:hover {
  transform: translateY(-2px);
  border-color: #f0b090;
  box-shadow: 0 8px 20px rgba(217, 74, 10, 0.12);
}

/* ========== WAREHOUSE STOCK FLOW HUB ========== */
.stock-flow-hub {
  display: grid;
  gap: 14px;
}

.sf-wh-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.sf-tab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
}

.sf-tab.active {
  background: var(--brand);
  color: #fff;
}

.sf-pane {
  display: none;
}

.sf-pane.active {
  display: block;
  animation: fadeUp 0.28s ease both;
}

.sf-floor {
  display: grid;
  gap: 16px;
  padding: 14px 16px 18px;
  background:
    linear-gradient(180deg, rgba(20, 32, 43, 0.03), transparent 40%),
    #f7f9fb;
}

.sf-rack {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sf-rack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #132231, #1c3347);
  color: #fff;
}

.sf-rack-head.is-link {
  cursor: pointer;
}

.sf-rack-head.is-link:hover {
  background: linear-gradient(90deg, #1a2f42, #244158);
}

.sf-rack-head span {
  font-size: 0.78rem;
  color: #9fb0c3;
}

.sf-rack-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
}

.sf-bin {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.sf-bin:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sf-bin.stk-low {
  border-color: #f0b0b0;
  background: #fff8f8;
}

.sf-bin.stk-mid {
  border-color: #f0d4a8;
  background: #fffbf5;
}

.sf-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(145deg, hsl(var(--sf-hue, 200), 55%, 42%), hsl(var(--sf-hue, 200), 45%, 28%));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sf-thumb i {
  position: absolute;
  inset: auto 8px 8px 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.sf-bin-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sf-bin-code {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sf-bin-body strong {
  font-size: 0.82rem;
}

.sf-bin-body > span {
  font-size: 0.74rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-bin-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.sf-bin-foot b {
  font-family: var(--display), Outfit, sans-serif;
  font-size: 1.05rem;
}

.sf-flow-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 220px;
  padding: 16px 14px 10px;
  overflow-x: auto;
}

.sf-flow-col {
  flex: 1 0 56px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.sf-stack {
  width: 100%;
  max-width: 42px;
  height: 160px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 2px;
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  background: #eef2f5;
  padding: 4px 0 0;
}

.sf-stack i {
  display: block;
  width: 100%;
  flex: 0 0 auto;
  border-radius: 3px 3px 2px 2px;
}

.sf-flow-col em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.sf-flow-col b {
  font-size: 0.78rem;
}

.sf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 0 14px 14px;
}

.sf-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.sf-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.sf-legend-item strong {
  color: var(--ink);
}

.sf-activity {
  display: grid;
  gap: 8px;
  padding: 12px 14px 16px;
}

.sf-act {
  display: grid;
  grid-template-columns: 52px 72px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.sf-act time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.sf-act-type {
  display: inline-grid;
  place-items: center;
  height: 26px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #eef2f5;
}

.sf-act.sf-in .sf-act-type {
  background: var(--success-soft);
  color: var(--success);
}

.sf-act.sf-out .sf-act-type {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.sf-act.sf-move .sf-act-type {
  background: var(--info-soft);
  color: var(--info);
}

.sf-act.sf-adjust .sf-act-type {
  background: var(--warning-soft);
  color: var(--warning);
}

.sf-act div {
  display: grid;
  gap: 2px;
}

.sf-act span {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.sf-act em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--ink-faint);
}

td .sf-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 0.7rem;
}

@media (max-width: 720px) {
  .sf-act {
    grid-template-columns: 1fr;
  }
}

/* Live warehouse stock ? QR ? find ? ops */
.sf-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sf-apps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(100px, 1fr);
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.sf-apps .pcat-app {
  min-width: 100px;
}

.sf-meta {
  font-size: 0.72rem !important;
  color: var(--ink-faint) !important;
}

.sf-bin-io {
  display: flex;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 800;
}

.sf-bin-io .in { color: var(--success); }
.sf-bin-io .out { color: var(--danger); }

.sf-qr-mini {
  padding: 4px 8px !important;
  font-size: 0.72rem !important;
}

.sf-qr {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-width: 110px;
}

.sf-qr-grid {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, #14202b 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, #14202b 0 2px, transparent 2px 4px),
    #fff;
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 8px #14202b;
}

.sf-qr em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.sf-qr code {
  font-size: 0.68rem;
  word-break: break-all;
  text-align: center;
}

.sf-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
}

.sf-bin-detail {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: start;
}

.sf-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sf-rack-detail {
  display: grid;
  gap: 14px;
}

.sf-rack-products {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.sf-rack-prod {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sf-rack-prod:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sf-rack-prod strong {
  display: block;
  font-size: 0.95rem;
}

.sf-rack-prod span,
.sf-rack-prod em {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-style: normal;
  margin-top: 2px;
}

.sf-rack-prod .sf-bin-io {
  margin-top: 6px;
  align-items: center;
}

.sf-rack-prod .sf-bin-io b {
  margin-left: auto;
  font-size: 0.85rem;
}

.sf-find-bar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.sf-find-bar .input {
  flex: 1;
  min-width: 180px;
}

.sf-find-results {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.sf-find-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.sf-find-card span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.sf-path-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.sf-path-flow em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3f7;
}

.sf-path-flow em.live {
  background: var(--success-soft);
  color: var(--success);
}

.sf-path-flow i {
  width: 14px;
  height: 2px;
  background: var(--line-strong);
}

.sf-range-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sf-qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
}

.sf-qr-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f7fafc);
}

.sf-bin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sf-ops-pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px;
}

.sf-ops-step {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sf-ops-step:hover {
  transform: translateY(-2px);
  border-color: #f0b090;
}

.sf-ops-step b {
  font-family: var(--display);
  font-size: 1.4rem;
}

.sf-ops-step span {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.sf-ops-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.sf-activity.compact {
  max-height: 280px;
  overflow: auto;
}

.sf-rack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sf-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
}

@media (max-width: 720px) {
  .sf-find-card {
    grid-template-columns: 48px 1fr;
  }

  .sf-find-card .btn-secondary {
    grid-column: 1 / -1;
  }

  .sf-bin-detail {
    grid-template-columns: 1fr;
  }

  .sf-ops-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-flow-hub .dash-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .sf-apps {
    margin-inline: -4px;
  }
}

/* ?? Parts Catalog Design (admin + public) ?? */
.cat-hub {
  display: grid;
  gap: 16px;
}

.cat-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(217, 74, 10, 0.08), transparent 55%),
    linear-gradient(180deg, #fff, #f7fafc);
}

.cat-share-bar strong {
  font-family: var(--display);
  font-size: 1.05rem;
}

.cat-share-bar p {
  margin: 4px 0 10px;
  color: var(--ink-muted);
  font-size: 0.86rem;
  max-width: 42rem;
}

.cat-share-url {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef3f7;
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--ink);
}

.cat-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-mode {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.cat-mode.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.cat-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.cat-app {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cat-app:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: hsl(var(--cat-hue, 200) 45% 55%);
}

.cat-app.active {
  border-color: hsl(var(--cat-hue, 200) 55% 42%);
  box-shadow: 0 0 0 2px hsl(var(--cat-hue, 200) 55% 42% / 0.2);
}

.cat-app-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: hsl(var(--cat-hue, 200) 45% 32%);
  background: hsl(var(--cat-hue, 200) 55% 94%);
}

.cat-app-ico svg {
  width: 28px;
  height: 28px;
}

.cat-app strong {
  font-family: var(--display);
  font-size: 0.95rem;
}

.cat-app em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.cat-app b {
  font-size: 0.78rem;
  color: hsl(var(--cat-hue, 200) 45% 32%);
}

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

.cat-chip-row > span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-right: 4px;
}

.cat-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.cat-chip.active {
  background: var(--brand-soft);
  border-color: #f0b89a;
  color: var(--brand-dark);
}

.cat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cat-toolbar .input {
  flex: 1;
  min-width: 200px;
}

.cat-toolbar span {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.cat-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cat-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, #fff 0%, transparent 45%),
    linear-gradient(145deg, hsl(var(--cat-hue, 200) 55% 88%), hsl(var(--cat-hue, 200) 40% 62%));
  color: hsl(var(--cat-hue, 200) 40% 22%);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
}

.cat-thumb.lg {
  width: 120px;
  height: 120px;
  font-size: 1.6rem;
  border-radius: 18px;
}

.cat-thumb i {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font-style: normal;
  font-size: 0.65rem;
  opacity: 0.75;
  font-weight: 700;
}

.cat-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cat-code {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}

.cat-card-body strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.cat-card-body span,
.cat-sup {
  font-size: 0.76rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.cat-card-foot b {
  font-family: var(--display);
  font-size: 1rem;
}

.cat-card-foot .btn-secondary {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.cat-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 20px;
  align-items: start;
}

.cat-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
}

.cat-gallery-hit {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f5f8;
}

.cat-gallery-hit img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.cat-gallery-hit span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 6px;
  background: linear-gradient(transparent, rgba(15, 26, 36, 0.75));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.cat-detail-meta {
  display: grid;
  gap: 8px;
}

.cat-detail-meta p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.cat-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  margin-top: 4px;
}

.cat-price-row b {
  font-family: var(--display);
  font-size: 1.35rem;
}

.cat-price-row span,
.cat-price-row em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.cat-howto {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.cat-howto h4 {
  margin: 0 0 10px;
  font-family: var(--display);
}

.cat-howto ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.cat-howto li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f8fb;
  border: 1px solid var(--line);
}

.cat-howto li b {
  font-size: 0.75rem;
  color: var(--brand-dark);
}

.cat-howto li span {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .cat-detail {
    grid-template-columns: 1fr;
  }

  .cat-howto li {
    grid-template-columns: 1fr;
  }
}

/* Public catalog page */
.catalog-public-body {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(217, 74, 10, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(30, 95, 138, 0.1), transparent 45%),
    linear-gradient(180deg, #eef3f7 0%, #f7f9fb 40%, #f3f6f8 100%);
  min-height: 100vh;
}

.pcat-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 80px;
  display: grid;
  gap: 18px;
}

.pcat-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.pcat-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pcat-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.pcat-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
}

.pcat-brand span {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.pcat-top-actions {
  display: flex;
  gap: 8px;
}

.pcat-cart-btn em {
  font-style: normal;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.78rem;
}

.pcat-hero {
  padding: 8px 2px 4px;
}

.pcat-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.pcat-hero p {
  margin: 8px 0 0;
  max-width: 36rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pcat-apps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(108px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pcat-app {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  min-width: 108px;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.pcat-app:hover,
.pcat-app.active {
  transform: translateY(-2px);
  border-color: hsl(var(--cat-hue, 200) 50% 45%);
}

.pcat-app.active {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pcat-app .cat-app-ico {
  width: 40px;
  height: 40px;
}

.pcat-app strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.pcat-filters {
  display: grid;
  gap: 10px;
}

.pcat-count {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.pcat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.pcat-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pcat-drawer.show,
.pcat-drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.pcat-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 36, 0.45);
}

.pcat-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(15, 26, 36, 0.18);
  transform: translateX(12px);
  transition: transform 0.22s ease;
}

.pcat-drawer.show .pcat-drawer-panel,
.pcat-drawer.open .pcat-drawer-panel {
  transform: translateX(0);
}

.pcat-drawer-panel header,
.pcat-drawer-panel footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.pcat-drawer-panel footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pcat-drawer-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.1rem;
}

.pcat-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.pcat-order-foot {
  flex-direction: column;
  align-items: stretch !important;
}

.pcat-order-form {
  display: grid;
  gap: 8px;
  width: 100%;
}

.pcat-cart-total {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.95rem;
}

.pcat-cart-total strong {
  font-family: var(--display);
  font-size: 1.2rem;
}

.pcat-cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.pcat-cart-line strong {
  display: block;
  font-size: 0.9rem;
}

.pcat-cart-line span {
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.pcat-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  grid-column: 2;
  grid-row: 1;
}

.pcat-qty button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f5f8fb;
  cursor: pointer;
  font: inherit;
}

.pcat-qty em {
  font-style: normal;
  font-weight: 700;
  min-width: 1.2rem;
  text-align: center;
}

.pcat-cart-line > b {
  grid-column: 2;
}

.pcat-cart-line .text-link {
  grid-column: 1;
  justify-self: start;
  background: none;
  border: 0;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  padding: 0;
}

@media (max-width: 560px) {
  .pcat-top-actions {
    width: 100%;
  }

  .pcat-top-actions .btn-primary,
  .pcat-top-actions .btn-secondary {
    flex: 1;
  }
}

/* ========== PO INTEL + SUPPLIER PORTAL ========== */
.move-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}
.move-fast { background: #e6f5ec; color: #1a7a4c; }
.move-mid { background: #eef4f8; color: #1e5f8a; }
.move-slow { background: #fff6e5; color: #b7791f; }
.move-dead { background: #fde8e8; color: #c0392b; }

.po-intel { margin: 14px 0; overflow: visible; }
.po-intel-body { padding: 0 14px 14px; }
.po-ai-box {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #132231, #1c3a2a);
  color: #e8f0ea;
}
.po-ai-box p { margin: 0 0 8px; font-size: 0.84rem; }
.po-ai-box .btn-secondary {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

.po-cmp, .po-cmp-list .po-cmp {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}
.po-cmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.po-cmp-grid b { color: var(--ink); }

.po-prod-insight {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f7faf8 0%, #f0f4f8 100%);
}
.po-prod-insight-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.po-prod-insight p {
  margin: 6px 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.po-prod-insight p b { color: var(--ink); }
.prod-insight-mini-links {
  margin-top: 8px;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.prod-insight-link { font-weight: 600; }
.prod-hit-extra {
  display: inline-flex;
  margin: 0 0 6px 8px;
  vertical-align: middle;
}
.prod-insight-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.prod-insight-head strong { display: block; font-size: 1.05rem; }
.prod-insight-head span { display: block; color: var(--ink-muted); }
.prod-insight-head em { font-style: normal; font-size: 0.8rem; color: var(--ink-muted); }
.prod-insight-stock {
  text-align: right;
  display: grid;
  gap: 4px;
  justify-items: end;
}
.prod-insight-stock b { font-size: 1.4rem; }
.prod-insight-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.prod-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.prod-insight-grid section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.prod-insight-grid h4,
.prod-insight h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.prod-insight-grid p { margin: 0; font-size: 0.84rem; }
@media (max-width: 720px) {
  .prod-insight-grid { grid-template-columns: 1fr; }
}

.gst-doc-sheet .gst-inv-title strong { color: #0d5c63; }

.login-portal-switch { margin-top: 8px; font-size: 0.84rem; }

.supplier-body .sup-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 400px at 10% 0%, rgba(26,122,76,0.12), transparent 50%),
    linear-gradient(160deg, #eef6f1 0%, #f3f6f8 45%, #e8f0ec 100%);
}
.bi-kpi.is-link.warn .value { color: #b7791f; }
.bi-kpi.is-link.danger .value { color: #c53030; }
.sup-kpi-section {
  margin: 14px 0 8px;
}
.sup-kpi-section em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sup-pay-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.sup-pay-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.sup-pay-tab:hover { border-color: #7cbc98; color: #1a7a4c; }
.sup-pay-tab.active {
  background: #e6f5ec;
  border-color: #7cbc98;
  color: #14653d;
}
.sup-notify-sheet {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}
.sup-notify-sheet p { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.sup-notify-sheet code {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #14653d;
  background: #e6f5ec;
  padding: 2px 8px;
  border-radius: 6px;
}
.supplier-body .sup-login[hidden] {
  display: none !important;
}
.supplier-shell[hidden] {
  display: none !important;
}
.supplier-shell:not([hidden]) {
  display: grid;
  min-height: 100vh;
}
.supplier-shell .admin-main {
  min-width: 0;
  min-height: 100vh;
  background: transparent;
}
.supplier-shell .sidebar {
  background: linear-gradient(180deg, #1a3d32 0%, #132a22 42%, #0e1f19 100%);
  z-index: 40;
}
.supplier-shell .sidebar-brand .brand-name { color: #d8f0e2; }
.supplier-shell .sidebar-brand .brand-sub { color: rgba(216, 240, 226, 0.75); }
.supplier-shell .nav-link.active {
  background: rgba(72, 180, 120, 0.22);
  color: #e8fff2;
}
.supplier-shell .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8fff2;
}
.supplier-shell .user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.78rem;
}
.supplier-shell .user-chip em {
  font-style: normal;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.sup-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}
.sup-flow-rail {
  display: none;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sup-flow-rail.is-visible { display: flex; }
.sup-flow-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.sup-flow-chip:hover { border-color: #7cbc98; color: #1a7a4c; }
.sup-flow-chip.active {
  background: #e6f5ec;
  border-color: #7cbc98;
  color: #14653d;
}
.sup-flow-sep {
  color: var(--ink-muted);
  font-size: 0.75rem;
}
#supBackBtn:disabled {
  opacity: 0.35;
  cursor: default;
}
.supplier-shell .home-btn.is-home {
  color: #1a7a4c;
  background: #e6f5ec;
  border-color: #b7e0c8;
}

.sup-view-enter {
  animation: supFadeIn 0.22s ease;
}
@keyframes supFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.supplier-dock {
  --dock-accent: #1a7a4c;
}
.supplier-dock .dock-item.active {
  color: #14653d;
}
.supplier-dock[hidden] {
  display: none !important;
}

.sup-query-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sup-query-card:last-child { border-bottom: 0; }
.sup-query-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.sup-query-card h4 { margin: 0 0 6px; font-size: 0.95rem; }
.sup-query-card > p { margin: 0 0 10px; font-size: 0.88rem; }
.sup-reply {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef7f1;
  border: 1px solid #c5e0d0;
}
.sup-reply em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.sup-reply p { margin: 0; font-size: 0.84rem; }
.sup-reply-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.sup-reply-box .ta { min-height: 72px; }
.sup-prod-detail .po-cmp-grid { margin: 10px 0; }
#supModalRoot { display: none; }
#supModalRoot.open {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 80;
}

.sup-tl, .sup-tl.big {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 14px 16px 18px;
}
.sup-tl-step {
  flex: 1;
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f7f9;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.sup-tl-step em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sup-tl-step.done { background: #e6f5ec; border-color: #b7e0c8; }
.sup-tl-step.delay { background: #fde8e8; border-color: #f0b0b0; }
.sup-tl-step.partial { background: #fff6e5; border-color: #f0d4a8; }
.sup-tl-arrow {
  align-self: center;
  color: var(--ink-muted);
  font-weight: 700;
}
.sup-tl-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.sup-tl-card:last-child { border-bottom: 0; }

.badge.delayed, .badge.issued, .badge.booked, .badge.due { background: #fff6e5; color: #b7791f; }
.badge.credit-note, .badge.adjusted { background: #eef4f8; color: #1e5f8a; }

@media (max-width: 900px) {
  .supplier-shell .sup-ribbon {
    padding: 8px 14px;
  }
  .supplier-shell .content {
    padding-bottom: 96px;
  }
  .supplier-shell .page-title {
    font-size: 1.05rem;
  }
  .supplier-shell .topbar-right .user-chip strong {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .supplier-shell .topbar-right .user-chip em {
    display: none;
  }
  .supplier-dock {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 720px) {
  .sup-tl.big { flex-direction: column; }
  .sup-tl-arrow { display: none; }
  .supplier-shell .sales-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .supplier-shell .sales-filters .btn-secondary,
  .supplier-shell .sales-filters .btn-primary {
    grid-column: 1 / -1;
  }
  .supplier-shell .table-wrap {
    margin: 0 -4px;
  }
  .supplier-shell .bi-kpi-grid,
  .supplier-shell .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .supplier-shell .panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .sup-flow-sep { display: none; }
  .sup-flow-rail {
    width: 100%;
    justify-content: space-between;
  }
  .sup-flow-chip {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
  }
}

@media (max-width: 560px) {
  .supplier-body .sup-login {
    padding: 16px;
    align-items: start;
    padding-top: 40px;
  }
  .supplier-body .login-form {
    width: 100%;
    max-width: 420px;
  }
  .supplier-shell .bi-kpi-grid,
  .supplier-shell .kpi-grid {
    grid-template-columns: 1fr;
  }
  .supplier-shell .sales-filters {
    grid-template-columns: 1fr;
  }
  .supplier-shell .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  #supModalRoot.open .modal-sheet {
    width: min(100vw - 16px, 720px);
    max-height: calc(100vh - 24px);
    margin: 8px;
  }
}

/* ========== SALES REPORT DRILLDOWN ========== */
.sales-report-page .sales-drill-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 0 10px;
  font-size: 0.82rem;
}
.sales-crumb {
  border: 0;
  background: none;
  color: var(--brand-dark, #b53d08);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.sales-crumb.current { color: var(--ink); cursor: default; }
.sales-crumb-sep { color: var(--ink-muted); }
.sales-drill-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sales-flow-step {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.sales-flow-step.done { color: var(--ink); }
.sales-flow-step.active {
  color: var(--brand-dark, #b53d08);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sales-flow-arrow { color: var(--ink-muted); font-size: 0.8rem; }
.sales-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.sales-channel-table tr.is-click { cursor: pointer; }
.sales-channel-table tr.is-click:hover td { background: rgba(217, 74, 10, 0.04); }
.sales-channel-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #f7fafc 100%);
}
.sales-mix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 16px 8px;
}
.sales-mix em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sales-mix strong { font-size: 1.05rem; }
.sales-inv-detail .detail-grid { margin-bottom: 4px; }
@media (max-width: 720px) {
  .sales-mix { grid-template-columns: 1fr; }
}

/* Brand sales analysis */
.brand-analysis-page .cat-mode-tabs {
  margin: 12px 0 14px;
}
.brand-bar-list {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}
.brand-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) 1fr auto;
  gap: 10px;
  align-items: center;
}
.brand-bar-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.brand-bar-label em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-muted);
}
.brand-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}
.brand-bar-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #e86a2a, #d94a0a);
  border-radius: 999px;
}
.brand-bar-row b {
  font-size: 0.84rem;
  white-space: nowrap;
}
.brand-bar-hit {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.brand-bar-hit:hover .brand-bar-track {
  background: #e4ebf2;
}
.cat-thumb-img {
  position: relative;
  overflow: hidden;
  padding: 0;
}
.cat-thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cat-thumb-img em {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(15, 26, 36, 0.72);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
}
@media (max-width: 720px) {
  .brand-bar-row {
    grid-template-columns: 1fr auto;
  }
  .brand-bar-track {
    grid-column: 1 / -1;
  }
}

/* ========== E-CATALOG (smaartconnect-style) ========== */
.ecat-body { background: linear-gradient(180deg, #eef3f7 0%, #f7f9fb 40%, #fff 100%); min-height: 100vh; }
.ecat-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: rgba(15,26,36,0.96); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ecat-brand { display: flex; gap: 10px; align-items: center; color: #fff; text-decoration: none; }
.ecat-brand img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; }
.ecat-brand strong { display: block; font-family: Outfit, Manrope, sans-serif; font-size: 0.95rem; }
.ecat-brand span { font-size: 0.72rem; opacity: 0.7; }
.ecat-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.ecat-nav button {
  border: 0; background: transparent; color: rgba(255,255,255,0.72);
  font-weight: 700; font-size: 0.78rem; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.ecat-nav button.active, .ecat-nav button:hover { background: rgba(217,74,10,0.25); color: #fff; }
.ecat-top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ecat-cart-btn em {
  display: inline-flex; min-width: 18px; height: 18px; border-radius: 999px;
  align-items: center; justify-content: center; background: #fff; color: #d94a0a;
  font-style: normal; font-size: 0.7rem; font-weight: 800; margin-left: 6px; padding: 0 5px;
}
.ecat-main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.ecat-hero {
  text-align: center; padding: 28px 16px 22px;
  background: radial-gradient(circle at 20% 20%, rgba(217,74,10,0.12), transparent 50%),
              linear-gradient(135deg, #0f1a24, #1c3348);
  color: #fff; border-radius: 18px; margin-bottom: 18px;
}
.ecat-hero-logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; object-fit: contain; }
.ecat-hero h1 { font-family: Outfit, Manrope, sans-serif; font-size: clamp(1.4rem, 3vw, 2rem); margin: 12px 0 8px; }
.ecat-hero p { opacity: 0.8; max-width: 560px; margin: 0 auto 16px; }
.ecat-hero-search { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ecat-hero-search .input { min-width: min(420px, 100%); }
.ecat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.ecat-tile {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 16px; cursor: pointer; box-shadow: 0 8px 24px rgba(15,26,36,0.04);
}
.ecat-tile strong { display: block; font-size: 0.92rem; margin-bottom: 4px; }
.ecat-tile span { font-size: 0.75rem; color: var(--ink-muted); }
.ecat-tile:hover { border-color: #f0b090; transform: translateY(-1px); }
.ecat-section { margin: 22px 0; }
.ecat-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ecat-section-head h2, .ecat-section h2 { font-size: 1.05rem; margin: 0 0 12px; font-family: Outfit, Manrope, sans-serif; }
.ecat-app-grid, .ecat-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ecat-brand-grid-lg { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.ecat-app, .ecat-brand {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px;
  display: grid; gap: 6px; justify-items: center; text-align: center; cursor: pointer;
}
.ecat-app:hover, .ecat-brand:hover { border-color: #f0b090; }
.ecat-brand img { width: 42px; height: 42px; object-fit: contain; }
.ecat-brand.lg img { width: 56px; height: 56px; }
.ecat-brand strong, .ecat-app strong { font-size: 0.84rem; }
.ecat-brand em, .ecat-app em { font-style: normal; font-size: 0.72rem; color: var(--ink-muted); }
.ecat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ecat-card {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
}
.ecat-card:hover { box-shadow: 0 10px 28px rgba(15,26,36,0.08); }
.ecat-card-body { padding: 12px; display: grid; gap: 4px; }
.ecat-card-brand { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--ink-muted); }
.ecat-card-brand img { width: 16px; height: 16px; object-fit: contain; }
.ecat-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.ecat-filters .input { flex: 1; min-width: 200px; }
.ecat-page-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ecat-page-head h1 { margin: 0; font-family: Outfit, Manrope, sans-serif; font-size: 1.35rem; }
.ecat-page-head p { margin: 4px 0 0; color: var(--ink-muted); font-size: 0.86rem; }
.ecat-fit-list { display: grid; gap: 12px; }
.ecat-fit-card {
  display: grid; grid-template-columns: 110px 1fr; gap: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.ecat-fit-card ol { margin: 8px 0; padding-left: 18px; font-size: 0.84rem; color: var(--ink-muted); }
.ecat-fit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ecat-ai-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ecat-ai-kpi {
  display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.ecat-ai-kpi img { width: 36px; height: 36px; object-fit: contain; }
.ecat-ai-kpi strong { display: block; font-size: 0.88rem; }
.ecat-ai-kpi span { font-size: 0.72rem; color: var(--ink-muted); }
.ecat-detail-panel { max-width: 560px; }
.ecat-detail-hero { display: grid; gap: 12px; }
.ecat-detail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ecat-detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #f2f5f8; }
.ecat-gallery-hit {
  position: relative; border: 0; padding: 0; background: transparent; cursor: zoom-in; border-radius: 10px; overflow: hidden;
}
.ecat-gallery-hit span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px;
  background: linear-gradient(transparent, rgba(15,26,36,.78)); color: #fff;
  font-size: 0.68rem; font-weight: 700; letter-spacing: .02em;
}
.ecat-gallery-hit:hover img { filter: brightness(1.05); }
.ecat-no-photo { text-align: center; color: var(--ink-muted); font-size: 0.82rem; }
.ecat-no-photo .cat-thumb { margin: 0 auto 8px; }
.ecat-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ecat-lightbox {
  position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center;
}
.ecat-lightbox.show { display: flex; }
.ecat-lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 24, 0.82); }
.ecat-lightbox-panel {
  position: relative; z-index: 1; width: min(920px, 94vw); max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ecat-lightbox-panel img {
  max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 12px;
  background: #101820; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.ecat-lightbox-close {
  position: absolute; top: -8px; right: -4px; width: 40px; height: 40px; border-radius: 999px;
  border: 0; background: #fff; font-size: 1.1rem; cursor: pointer; z-index: 2;
}
.ecat-lightbox-nav {
  position: absolute; top: 42%; width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.92); font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.ecat-lightbox-nav.prev { left: -8px; }
.ecat-lightbox-nav.next { right: -8px; }
.ecat-lightbox-meta {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  color: #fff; font-size: 0.88rem;
}
.pcat-drawer.open,
.pcat-drawer.show {
  pointer-events: auto;
  opacity: 1;
}
.pcat-drawer.open .pcat-drawer-panel,
.pcat-drawer.show .pcat-drawer-panel {
  transform: translateX(0);
}
.ecat-brand-pill { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ecat-brand-pill img { width: 28px; height: 28px; object-fit: contain; }
.ecat-howto { padding-left: 18px; display: grid; gap: 8px; font-size: 0.9rem; }
.ecat-ai-tip {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #fff6f0; border: 1px solid #f0b090; font-size: 0.82rem;
}
.cat-thumb-logo { position: absolute; width: 28px; height: 28px; top: 8px; right: 8px; object-fit: contain; opacity: 0.9; }
.cat-thumb { position: relative; }

/* ========== BRAND 360 ========== */
.brand360-page .b360-toolbar { align-items: flex-start; }
.b360-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.b360-search-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.b360-search-bar .input { flex: 1; min-width: min(240px, 100%); }
.b360-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; align-items: center;
}
.b360-chips .cat-chip { display: inline-flex; align-items: center; gap: 6px; }
.b360-chips .cat-chip img { width: 16px; height: 16px; object-fit: contain; }
.b360-hero {
  background: linear-gradient(135deg, #102232 0%, #1a3a52 55%, #243f55 100%);
  color: #fff; border-radius: 16px; padding: 18px 18px 16px; margin-bottom: 14px;
}
.b360-focus { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.b360-focus img {
  width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px;
}
.b360-focus em { font-style: normal; font-size: 0.72rem; opacity: 0.7; }
.b360-focus h2 { margin: 2px 0 4px; font-family: Outfit, Manrope, sans-serif; font-size: 1.35rem; }
.b360-focus p { margin: 0; opacity: 0.85; font-size: 0.86rem; }
.b360-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.b360-grid { align-items: start; }
.b360-mini-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.b360-wh-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px;
}
.b360-wh-kpis > div {
  background: #f4f7fa; border-radius: 12px; padding: 12px; text-align: center;
}
.b360-wh-kpis b { display: block; font-size: 1.15rem; font-family: Outfit, Manrope, sans-serif; }
.b360-wh-kpis span { font-size: 0.72rem; color: var(--ink-muted); }
.b360-advice { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 0.88rem; }
.b360-advice em { color: var(--ink-muted); font-style: normal; }
.b360-ai-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.b360-v {
  display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: .02em;
}
.b360-v.buy { background: #e6f6ed; color: #1b7a45; }
.b360-v.light { background: #e8f1ff; color: #2558b5; }
.b360-v.hold { background: #fff6e8; color: #a15c00; }
.b360-v.no { background: #fdecec; color: #b42318; }
.b360-flow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px;
}
.b360-flow-step {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: grid; gap: 4px;
}
.b360-flow-step em {
  width: 22px; height: 22px; border-radius: 999px; background: #102232; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 0.72rem; font-weight: 800;
}
.b360-flow-step strong { font-size: 0.84rem; }
.b360-flow-step span { font-size: 0.75rem; color: var(--ink-muted); }
.muted { color: var(--ink-muted); font-size: 0.78rem; }
@media (max-width: 900px) {
  .b360-wh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b360-focus { flex-direction: column; align-items: flex-start; }
  .b360-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .b360-tabs .cat-mode { flex: 0 0 auto; }
}

/* Catalog app-like responsive */
.ecat-bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(15, 26, 36, 0.97); border-top: 1px solid rgba(255,255,255,0.08);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around; gap: 2px;
}
.ecat-bottom-nav button {
  flex: 1; border: 0; background: transparent; color: rgba(255,255,255,0.65);
  font-size: 0.62rem; font-weight: 700; padding: 8px 4px; border-radius: 10px; cursor: pointer;
  display: grid; gap: 2px; justify-items: center;
}
.ecat-bottom-nav button strong { font-size: 0.95rem; line-height: 1; font-weight: 800; }
.ecat-bottom-nav button.active, .ecat-bottom-nav button:hover { color: #fff; background: rgba(217,74,10,0.28); }
.ecat-b360-banner {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin: 0 0 16px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(120deg, #122536, #1e3d55); color: #fff;
}
.ecat-b360-banner strong { font-family: Outfit, Manrope, sans-serif; }
.ecat-b360-banner p { margin: 2px 0 0; font-size: 0.78rem; opacity: 0.8; }
.ecat-b360-banner a, .ecat-b360-banner .btn-secondary {
  background: #fff; color: #122536; border: 0; text-decoration: none;
  padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 0.8rem;
}

@media (max-width: 800px) {
  .ecat-nav { display: none; }
  .ecat-bottom-nav { display: flex; }
  .ecat-main { padding-bottom: 88px; }
  .ecat-fit-card { grid-template-columns: 1fr; }
  .ecat-lightbox-nav.prev { left: 4px; }
  .ecat-lightbox-nav.next { right: 4px; }
  .ecat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .ecat-card-actions { width: 100%; }
  .ecat-card-actions .btn-secondary { flex: 1; padding: 8px 6px; font-size: 0.72rem; }
  .ecat-top-actions .btn-secondary:not(.ecat-cart-btn) { display: none; }
  .ecat-hero { border-radius: 14px; padding: 22px 14px 18px; }
  .ecat-filters { flex-direction: column; align-items: stretch; }
  .ecat-filters .input, .ecat-filters .select { width: 100%; min-width: 0; }
  .ecat-detail-panel { max-width: 100%; }
}
