:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-50: #fef2f2;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--slate-900);
  background: var(--slate-100);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-600); }

.app-shell { min-height: 100%; }

/* Landing / auth */
.auth-boot {
  min-height: 100vh;
  background: var(--slate-100);
}
.auth-boot-card {
  display: none;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.auth-visual {
  position: relative;
  background: linear-gradient(180deg, var(--blue-900) 0%, var(--slate-900) 100%);
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute;
  inset: auto -10% -20% 30%;
  height: 60%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='200' cy='200' r='160' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3Ccircle cx='200' cy='200' r='110' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  animation: fadeUp 0.6s ease both;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  transform-origin: center;
  cursor: pointer;
}
.pin-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1.25rem;
}
.pin-gate-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}
.pin-gate-card h2 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}
.pin-gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
}
.brand-title { font-size: 1.1rem; }
.brand-title-mob { display: none; }
.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.9);
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 0 rgba(56, 189, 248, 0)); }
  50% { filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 12px rgba(56, 189, 248, 0.45)); }
}
@keyframes livePulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(16, 185, 129, 0);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    transform: scale(0.95);
  }
}
.sc-live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  animation: livePulseDot 1.4s infinite ease-in-out;
  margin-right: 4px;
}
.sc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.82) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
.aside-logo,
.brand-logo {
  animation: logoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both, logoFloat 3.6s ease-in-out 0.7s infinite, logoGlow 4.8s ease-in-out 0.7s infinite;
}
.auth-hero {
  position: relative;
  z-index: 1;
  animation: fadeUp 0.7s ease 0.08s both;
}
.auth-eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.95);
}
.auth-hero h1 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1.15rem;
  max-width: 18ch;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-align: left;
}
.auth-tips {
  position: relative;
  min-height: 4.8rem;
  max-width: 38ch;
  margin-bottom: 1.35rem;
}
.auth-tip {
  position: absolute;
  inset: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(10px);
  animation: tipCycle 16s ease-in-out infinite;
}
.auth-tip.tip-1 { animation-delay: 0s; }
.auth-tip.tip-2 { animation-delay: 4s; }
.auth-tip.tip-3 { animation-delay: 8s; }
.auth-tip.tip-4 { animation-delay: 12s; }
.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 34ch;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
  opacity: 0;
  animation: fadeUp 0.55s ease both;
}
.auth-points li:nth-child(1) { animation-delay: 0.25s; }
.auth-points li:nth-child(2) { animation-delay: 0.4s; }
.auth-points li:nth-child(3) { animation-delay: 0.55s; }
.point-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
  flex-shrink: 0;
  animation: pulseDot 2.2s ease-in-out infinite;
}
.auth-foot-note {
  font-size: 0.8rem;
  opacity: 0.7;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s ease 0.35s both;
}
.auth-foot-version {
  display: block;
  margin-top: 0.28rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.95;
}
@keyframes tipCycle {
  0%, 4% { opacity: 0; transform: translateY(10px); }
  8%, 22% { opacity: 1; transform: translateY(0); }
  28%, 100% { opacity: 0; transform: translateY(-8px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15); }
  50% { box-shadow: 0 0 0 7px rgba(96, 165, 250, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-tip,
  .auth-hero,
  .brand-mark,
  .brand-logo,
  .aside-logo,
  .auth-points li,
  .auth-foot-note,
  .point-dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .auth-tips { min-height: 0; }
  .auth-tip {
    position: static;
    margin-bottom: 0.65rem;
  }
  .auth-tip + .auth-tip { display: none; }
}
.auth-foot-login { display: none; }
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--slate-100);
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}
.auth-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}
.auth-sub { margin: 0 0 1.35rem; color: var(--slate-500); font-size: 0.92rem; line-height: 1.45; overflow-wrap: break-word; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  background: var(--slate-100);
  padding: 0.25rem;
  border-radius: 8px;
  margin-bottom: 1.15rem;
  border: 1px solid var(--slate-200);
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--slate-500);
  font-weight: 600;
}
.tabs button.active {
  background: #fff;
  color: var(--blue-700);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.req-search-field {
  width: 100%;
  margin-bottom: 0.25rem;
}
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  color: var(--slate-900);
  font: inherit;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 2.75rem;
}
.password-masked {
  -webkit-text-security: disc;
  text-security: disc;
}
.auth-form {
  margin: 0;
}
.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.password-toggle:hover {
  color: var(--slate-800);
  background: var(--slate-50);
}
.password-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
}
.password-toggle .eye-closed { display: none; }
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }
.field input:focus,
.field select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--blue-500);
}
.field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--slate-500);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.settings-stack {
  display: grid;
  gap: 1rem;
  max-width: 520px;
}
.settings-stack-wide {
  max-width: 920px;
}
.settings-card {
  padding: 1.15rem 1.25rem;
}
.settings-card-wide {
  max-width: 100%;
}
.settings-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--slate-900);
}
.settings-sub {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  color: var(--slate-500);
  line-height: 1.4;
}
.api-block {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--slate-200);
}
.api-block:first-of-type {
  margin-top: 0.35rem;
}
.api-block-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--slate-800);
}
.api-token-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.api-token-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}
.api-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.api-doc-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--slate-600);
  font-size: 0.86rem;
  line-height: 1.5;
}
.api-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.api-doc-table th,
.api-doc-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}
.api-doc-table th {
  color: var(--slate-500);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.api-doc-table code {
  font-size: 0.78rem;
  word-break: break-word;
}
.api-pre {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--slate-800);
}
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}
.supplier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.supplier-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.supplier-card:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.supplier-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate-900);
  overflow-wrap: anywhere;
}
.supplier-card-meta {
  font-size: 0.8rem;
  color: var(--slate-500);
}
.supplier-card-go {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-600);
}
.supplier-add-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.supplier-add-row input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  color: var(--slate-900);
  font: inherit;
}
.supplier-add-row .btn {
  width: auto;
  white-space: nowrap;
}
.btn {
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: none; }
.btn-primary {
  background: var(--blue-600);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--blue-700); }
.cell-actions .btn,
.cell-actions .btn-primary,
.cell-actions .btn-secondary {
  width: auto;
  flex: 0 0 auto;
}
.btn-secondary {
  background: #fff;
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-500); }
.btn-ghost {
  background: transparent;
  color: var(--blue-600);
  border: 0;
  padding: 0.35rem 0.5rem;
  font-weight: 600;
}
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.82rem; border-radius: 8px; }
.auth-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--blue-800);
  line-height: 1.45;
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.auth-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.95rem;
}
.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--slate-700);
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.remember-me input {
  width: auto;
  margin: 0;
  accent-color: var(--blue-600);
}
.auth-forgot-link,
.auth-back-link {
  font-size: 0.86rem;
  padding: 0;
  color: var(--blue-600);
}
.auth-back-link {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
}
.auth-notice {
  background: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
}
.auth-error {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}
.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--slate-900);
  color: #e2e8f0;
  font-size: 0.72rem;
  text-align: center;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.app-toast {
  position: fixed;
  top: 2.6rem;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  max-width: min(480px, calc(100vw - 2rem));
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  z-index: 220;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(6, 95, 70, 0.14);
  overflow-wrap: anywhere;
  text-align: center;
  animation: toastIn 0.22s ease;
}
.app-toast.is-error {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
  box-shadow: 0 10px 28px rgba(154, 52, 18, 0.12);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.mobile-menu-btn { display: none; }
.mobile-dock,
.mobile-sheet-overlay { display: none; }

/* App layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  padding-top: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
.aside {
  background: linear-gradient(180deg, var(--blue-900) 0%, var(--slate-900) 100%);
  color: #fff;
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  min-width: 0;
}
.aside-top { min-width: 0; }
.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.aside-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.aside-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  cursor: pointer;
}
.aside-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.15;
}
.aside-brand-title {
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aside-brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(147, 197, 253, 0.75);
}
.aside-user {
  margin: 0 0.35rem 0.85rem;
  padding: 0.75rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.aside-user .name { font-weight: 700; font-size: 0.92rem; overflow-wrap: anywhere; }
.aside-user .role { font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); margin-top: 0.15rem; }
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-group-toggle {
  justify-content: space-between;
}
.nav-caret {
  font-size: 0.75rem;
  opacity: 0.75;
}
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.15rem 0 0.35rem 0.55rem;
}
.nav-group.open .nav-sub { display: flex; }
.nav-sub-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.nav-sub-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-sub-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-steps {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.2rem 0 0.35rem 0.45rem;
}
.nav-step-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}
.nav-step-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.nav-step-btn.active {
  background: rgba(37, 99, 235, 0.65);
  color: #fff;
}
.nav-step-btn.locked,
.nav-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.nav-step-btn.active .nav-step-num {
  background: rgba(255, 255, 255, 0.22);
}
.nav-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.nav-step-text strong {
  font-size: 0.8rem;
  font-weight: 700;
}
.nav-step-text small {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
}
.nav-step-btn.active .nav-step-text small {
  color: rgba(255, 255, 255, 0.8);
}
.req-workspace.embedded.single {
  grid-template-columns: 1fr;
}
.hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}
.hist-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.hist-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.hist-card h3 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--slate-900);
  overflow-wrap: anywhere;
}
.hist-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--slate-500);
}
.hist-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--slate-500);
}
.hist-card-row strong {
  color: var(--slate-800);
  text-align: right;
  overflow-wrap: anywhere;
}
.hist-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.req-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.req-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.req-view-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.req-view-head {
  margin: 0;
}
.req-view-group {
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 12px;
  padding: 0.75rem 0.85rem 0.35rem;
}
.req-view-cat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
}
.req-view-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
}

.dash-hint-body {
  padding: 1rem 1.15rem 1.15rem;
}
.dash-hint-body p { margin: 0 0 0.45rem; color: var(--slate-700); }
.dash-hint-body .muted { color: var(--slate-500); font-size: 0.88rem; margin: 0; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-btn.active {
  background: var(--blue-600);
  color: #fff;
}
.nav-section {
  margin: 0.75rem 0.7rem 0.3rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}
.aside-foot {
  margin-top: auto;
  padding: 0.75rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.aside-version {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(191, 219, 254, 0.85);
  margin-bottom: 0.5rem;
}
.aside-foot .btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.aside-foot .btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }
.main {
  padding: 1.35rem 1.5rem 2.25rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--slate-100);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  min-width: 0;
}
.greeting { min-width: 0; flex: 1; }
.topbar-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.greeting h1 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--slate-900);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.greeting .sub {
  margin: 0.3rem 0 0;
  color: var(--slate-500);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.clock {
  text-align: right;
  color: var(--slate-500);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.clock .time {
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate-800);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue-600);
}
.stat .lbl {
  font-size: 0.7rem;
  color: var(--slate-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat .val {
  font-size: 1.65rem;
  font-weight: 700;
  margin-top: 0.2rem;
  color: var(--blue-700);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.panel {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 100%;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.05rem;
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 0.95rem; color: var(--slate-800); }
.panel-note {
  font-size: 0.8rem;
  color: var(--slate-500);
}
.arrival-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.arrival-group .panel-head h3 {
  color: var(--blue-800);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}
.arrival-group .panel-note {
  margin: 0.2rem 0 0;
}
.arrival-group-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.arrival-group-actions .btn {
  width: auto;
  flex: 0 0 auto;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--slate-200);
  overflow-wrap: anywhere;
  word-break: break-word;
}
th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  font-weight: 700;
  background: var(--slate-50);
}
tr:last-child td { border-bottom: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-muted { background: var(--slate-100); color: var(--slate-500); }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.quick-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.15rem 1.15rem;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1rem 1.05rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.quick-card:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.quick-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate-900);
}
.quick-card-sub {
  font-size: 0.8rem;
  color: var(--slate-500);
  line-height: 1.35;
}
.quick-card-go {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-600);
}
.draft-strip {
  margin: 0 0 1.15rem;
}
.draft-strip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.draft-strip-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: var(--slate-900);
}
.draft-strip-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--slate-500);
  line-height: 1.35;
}
.draft-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.draft-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  text-align: left;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  color: inherit;
  font: inherit;
  min-height: 120px;
}
.draft-card.is-active {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2), var(--shadow);
  background: var(--blue-50);
}
.draft-card-body h3 {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: var(--slate-900);
  overflow-wrap: anywhere;
}
.draft-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.35;
}
.draft-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.draft-card-new {
  align-items: flex-start;
  cursor: pointer;
  border-style: dashed;
  background: var(--slate-50);
}
.draft-card-new:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.draft-card-plus {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--blue-600);
  line-height: 1;
}
.draft-card-new strong {
  font-size: 0.9rem;
  color: var(--slate-900);
}
.cleanup-card {
  background: linear-gradient(180deg, var(--blue-900) 0%, var(--slate-900) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 0;
  box-shadow: var(--shadow);
  max-width: 100%;
}
.cleanup-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.cleanup-card p { margin: 0 0 0.9rem; color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; }
.cleanup-card .btn-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.cleanup-card .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); }

.cleanup-embed {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 2.2rem);
  min-height: 480px;
  margin-top: 2.2rem;
  background: var(--slate-100);
}
.cleanup-embed-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
}
.cleanup-embed-label {
  flex: 1;
  min-width: 140px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-500);
}
.cleanup-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 0;
}

/* Modal — full-screen requisition */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  animation: fadeIn 0.18s ease;
}
.modal-back.fullscreen {
  padding: 0;
  padding-top: 28px;
  background: #fff;
  backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
  animation: none;
  box-sizing: border-box;
}
.modal {
  width: min(640px, 100%);
  max-height: min(92vh, 860px);
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  animation: rise 0.2s ease;
  border: none;
}
.modal.fullscreen,
.req-modal.fullscreen {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 100%;
  border-radius: 0 !important;
  box-shadow: none !important;
  animation: none !important;
  overflow: hidden;
  margin: 0;
}
.page-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.2rem;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.page-tab {
  border: 0;
  background: transparent;
  color: var(--slate-500);
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.page-tab:hover { color: var(--slate-800); background: var(--slate-50); }
.page-tab.active {
  background: var(--blue-600);
  color: #fff;
}
.page-tab-body { min-width: 0; width: 100%; }
.req-page,
.req-modern-container {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.req-workspace.embedded {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  height: auto;
  max-height: none;
  width: 100%;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
.req-workspace.embedded .req-side {
  border-radius: 0;
}
.req-workspace.embedded .req-top {
  padding: 1.1rem 1.35rem 0.85rem;
}
.req-workspace.embedded .req-tabs {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}
.req-workspace.embedded .req-content {
  padding: 0;
  width: 100%;
}
.req-workspace.embedded .req-foot {
  padding: 0.85rem 1.35rem;
}

@media (max-width: 960px) {
  .req-workspace.embedded {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}
.req-side {
  background: linear-gradient(180deg, var(--blue-900) 0%, var(--slate-900) 100%);
  color: #fff;
  padding: 1rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  overflow: auto;
}
.req-side-brand {
  font-weight: 700;
  font-size: 1rem;
  padding: 0.35rem 0.55rem 0.15rem;
  letter-spacing: -0.02em;
}
.req-side-tag {
  margin: 0 0.55rem 0.85rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}
.req-side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.req-side-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}
.req-side-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.req-side-btn.active {
  background: var(--blue-600);
  color: #fff;
}
.req-side-btn.locked,
.req-side-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.req-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.req-side-btn.active .req-step-num { background: rgba(255, 255, 255, 0.22); }
.req-side-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.req-side-text strong {
  font-size: 0.84rem;
  font-weight: 700;
}
.req-side-text small {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
}
.req-side-btn.active .req-side-text small { color: rgba(255, 255, 255, 0.8); }
.req-side-summary {
  margin-top: auto;
  margin-bottom: 0.65rem;
  padding: 0.7rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.req-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}
.req-sum-row strong {
  color: #fff;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}
.req-side-close {
  width: 100%;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}
.req-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--slate-100);
}
.req-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.75rem 1.1rem;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  flex-shrink: 0;
}
.req-top-text { min-width: 0; flex: 1; }
.req-back-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--blue-600);
  font-weight: 650;
  font-size: 0.84rem;
  padding: 0;
  margin: 0 0 0.65rem;
  cursor: pointer;
}
.req-back-link:hover { color: var(--blue-800); text-decoration: underline; }
.req-top h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.req-top p {
  margin: 0.4rem 0 0;
  color: var(--slate-500);
  font-size: 0.9rem;
  line-height: 1.4;
}
.req-top-x {
  width: 40px;
  height: 40px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  color: var(--slate-700);
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.req-top-x:hover { background: var(--slate-50); }
.req-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.65rem 1.75rem 0;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.req-tab {
  border: 0;
  background: transparent;
  color: var(--slate-500);
  font-weight: 650;
  font-size: 0.86rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}
.req-tab:hover { color: var(--slate-800); }
.req-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-600);
}
.req-tab.locked,
.req-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.req-content {
  flex: 0 1 auto;
  overflow: visible;
  padding: 0;
  min-height: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.req-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--slate-200);
}
.req-panel-actions .btn,
.req-panel-actions .btn-primary,
.req-panel-actions .btn-secondary,
.req-panel-actions .btn-accent,
.req-panel-actions .btn-outline,
.req-table-card-foot .btn,
.req-table-card-foot .btn-primary,
.req-foot .btn,
.req-foot .btn-primary,
.req-foot .btn-accent,
.req-foot .btn-outline {
  width: fit-content;
  max-width: 100%;
  flex: 0 0 auto;
  white-space: nowrap;
}
.req-panel-actions .btn-primary,
.req-panel-actions .btn-accent,
.req-table-card-foot .btn-primary {
  margin-left: auto;
  min-height: 42px;
  padding: 0.55rem 1.15rem;
}
.req-panel {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.2rem;
  box-shadow: var(--shadow);
  max-width: none;
  width: 100%;
  min-width: 0;
}
.req-content.has-catalog .req-panel {
  max-width: none;
}
.req-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
}
.req-split.has-catalog {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}
.catalog-browser {
  width: 100%;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(70vh, 640px);
  overflow: hidden;
  position: sticky;
  top: 0.5rem;
}
.catalog-browser-head {
  padding: 0 0 0.65rem;
  border-bottom: 0;
  background: transparent;
  flex-shrink: 0;
}
.catalog-browser-head h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  color: var(--slate-900);
}
.catalog-browser-head p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--slate-500);
  line-height: 1.35;
}
.catalog-browser-body {
  overflow: auto;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  -webkit-overflow-scrolling: touch;
}
.cat-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
}
.cat-card.open {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), var(--shadow);
}
.cat-card-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 0;
  background: #fff;
  padding: 0.75rem 0.8rem;
  cursor: pointer;
  text-align: left;
  color: var(--slate-800);
}
.cat-card.open .cat-card-btn {
  background: var(--blue-50);
  border-bottom: 1px solid var(--slate-200);
}
.cat-card-btn:hover {
  background: var(--slate-50);
}
.cat-card.open .cat-card-btn:hover {
  background: var(--blue-50);
}
.cat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.cat-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 700;
  min-width: 0;
  letter-spacing: 0.02em;
}
.cat-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--slate-500);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 0.12rem 0.4rem;
  flex-shrink: 0;
}
.cat-card.open .cat-count {
  color: var(--blue-600);
  border-color: rgba(37, 99, 235, 0.25);
  background: #fff;
}
.cat-card-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate-500);
}
.cat-card.open .cat-card-hint {
  color: var(--blue-600);
}
.cat-dropdown {
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
}
.cat-dropdown-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem 0.15rem;
}
.cat-sel-count {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--slate-500);
}
.cat-items {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.45rem 0.35rem;
  max-height: 200px;
  overflow: auto;
}
.cat-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  margin-bottom: 0.3rem;
  cursor: pointer;
}
.cat-item-row:last-child { margin-bottom: 0; }
.cat-item-row:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.cat-item-row.is-checked {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.cat-item-check {
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 0.95rem;
  height: 0.95rem;
  accent-color: var(--blue-600);
  cursor: pointer;
}
.cat-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.cat-item-name {
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--slate-900);
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.cat-item-meta {
  font-size: 0.68rem;
  color: var(--slate-500);
}
.cat-dropdown-foot {
  padding: 0.45rem;
  border-top: 1px solid var(--slate-200);
  background: #fff;
}
.cat-dropdown-foot .btn {
  width: 100%;
}
.cat-dropdown-foot .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1180px) {
  .req-split,
  .req-split.has-catalog {
    grid-template-columns: 1fr !important;
  }
  .catalog-browser {
    display: none !important;
  }
  .new-item-grid {
    grid-template-columns: 1fr 1fr;
  }
  .req-sort-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .sort-mode-btns {
    width: 100%;
    justify-content: flex-start;
  }
  .btn-finish-order {
    width: fit-content;
  }
}
@media (max-width: 640px) {
  .new-item-grid {
    grid-template-columns: 1fr;
  }
}
.req-panel-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--slate-900);
}
.req-panel-sub {
  margin: 0 0 1rem;
  color: var(--slate-500);
  font-size: 0.88rem;
}
.req-workspace .req-foot {
  background: #fff;
  border-top: 1px solid var(--slate-200);
  margin: 0;
  padding: 0.95rem 1.75rem;
  flex-shrink: 0;
}
.req-workspace .req-list-box { margin-top: 0.75rem; }

/* legacy red header kept unused but harmless */
.modal-head {
  padding: 1rem 1.25rem 0.95rem;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--slate-50);
  flex-shrink: 0;
  min-width: 0;
}
.req-head > div:first-child {
  min-width: 0;
  flex: 1;
}
.req-head {
  background: var(--red-600);
  color: #fff;
}
.req-head h2 {
  margin: 0;
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  word-wrap: break-word;
}
.req-head p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 56ch;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.modal-x {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  border-radius: 6px;
  padding: 0;
  display: grid;
  place-items: center;
}
.modal-x:hover { background: rgba(255, 255, 255, 0.15); }
.modal-body {
  padding: 1rem 1.25rem;
  overflow: auto;
  flex: 1;
  min-width: 0;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.req-body {
  max-width: none;
  width: 100%;
  margin: 0;
  min-width: 0;
  box-sizing: border-box;
}
.req-body .field { min-width: 0; }
.req-body .field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 0.4rem;
}
.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  min-width: 0;
}
.meta-row input,
.meta-row select {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  box-sizing: border-box;
  font: inherit;
  color: var(--slate-900);
}
.search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  width: 100%;
  flex-wrap: wrap;
}
.search-row .btn-browse-catalog {
  flex: 0 0 auto;
  white-space: nowrap;
}
@keyframes req-search-bg {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes req-search-stroke {
  0%, 100% {
    border-color: #2563eb;
    box-shadow:
      0 0 0 1px rgba(37, 99, 235, 0.18),
      0 0 0 4px rgba(37, 99, 235, 0.10),
      0 8px 18px rgba(37, 99, 235, 0.08);
  }
  50% {
    border-color: #60a5fa;
    box-shadow:
      0 0 0 1px rgba(96, 165, 250, 0.28),
      0 0 0 6px rgba(59, 130, 246, 0.16),
      0 10px 22px rgba(37, 99, 235, 0.16);
  }
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}
.search-wrap.has-selected-hit input {
  border-color: var(--blue-600);
  background: linear-gradient(120deg, #ffffff 0%, #dbeafe 45%, #eff6ff 100%);
  background-size: 200% 200%;
  font-weight: 600;
  padding-right: 2rem;
  animation: req-search-bg 4.8s ease-in-out infinite, req-search-stroke 2.6s ease-in-out infinite;
}
.search-clear-hit {
  position: absolute;
  right: 0.5rem;
  border: none;
  background: transparent;
  color: var(--slate-400);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.search-clear-hit:hover {
  color: var(--red-600);
  background: var(--red-50);
}
.qty-add-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex: 0 0 auto;
}
.qty-add-group .qty-input {
  width: 76px;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
}
.qty-add-group .btn-add-line {
  white-space: nowrap;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
}
.selected-hit-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  padding: 0.5rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1e40af;
  font-size: 0.82rem;
}
.banner-badge {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
}
.search-ico {
  position: absolute;
  left: 0.85rem;
  color: var(--blue-600);
  display: flex;
  pointer-events: none;
  z-index: 1;
}
.search-wrap input {
  width: 100%;
  max-width: 100%;
  border: 2px solid var(--blue-600);
  border-radius: 10px;
  padding: 0.78rem 0.9rem 0.78rem 2.45rem;
  color: var(--slate-900);
  box-sizing: border-box;
  background: linear-gradient(120deg, #ffffff 0%, #eff6ff 28%, #dbeafe 52%, #ffffff 100%);
  background-size: 220% 220%;
  animation: req-search-bg 4.8s ease-in-out infinite, req-search-stroke 2.6s ease-in-out infinite;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-wrap input::placeholder {
  color: #64748b;
  opacity: 1;
}
.search-wrap input:hover {
  border-color: var(--blue-700);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--blue-700);
  animation: req-search-bg 3.2s ease-in-out infinite, req-search-stroke 1.6s ease-in-out infinite;
}
.qty-input:focus,
.meta-row input:focus,
.meta-row select:focus,
.new-item-form input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  border-color: var(--blue-500);
}
@media (prefers-reduced-motion: reduce) {
  .search-wrap input,
  .search-wrap input:focus {
    animation: none;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  }
}
.qty-input {
  width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.65rem 0.4rem;
  text-align: center;
  background: #fff;
  box-sizing: border-box;
}
.search-results {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  max-height: 240px;
  overflow-y: auto;
}
.search-hit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--slate-100);
  background: #fff;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  min-width: 0;
}
.search-hit:last-child { border-bottom: none; }
.search-hit:hover { background: var(--blue-50); }
.hit-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--slate-900);
  min-width: 0;
  overflow-wrap: anywhere;
}
.hit-meta { font-size: 0.78rem; color: var(--slate-500); white-space: nowrap; }
.hit-sku-pill {
  font-family: monospace;
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.74rem;
}
.hit-add { font-size: 0.78rem; font-weight: 700; color: var(--blue-600); }
.search-empty {
  margin-top: 0.4rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  color: var(--slate-500);
  border: 1px dashed var(--slate-200);
  border-radius: 8px;
}
.req-list-box {
  margin: 0.85rem 0 0.35rem;
  border-radius: 10px;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}
.req-list-box.empty-state {
  border: 1px dashed var(--slate-300);
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.15rem 1rem;
}
.empty-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--slate-900);
}
.empty-sub {
  margin: 0;
  max-width: 36ch;
  font-size: 0.84rem;
  color: var(--slate-500);
  line-height: 1.45;
}
.req-list-box.has-items {
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  background: #fff;
}
.req-list-box .table-wrap {
  margin: 0;
  border: none;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.req-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: fixed;
}
.req-table th,
.req-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--slate-200);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.req-table th.col-prod,
.req-table td.col-prod {
  width: 36%;
  white-space: normal;
  word-break: break-word;
}
.req-table th.col-sku,
.req-table td.col-sku { width: 12%; }
.req-table th.col-cat,
.req-table td.col-cat { width: 16%; }
.req-table th.col-model,
.req-table td.col-model {
  width: 14%;
  white-space: normal;
  word-break: break-word;
}
.req-table th.col-qty,
.req-table td.col-qty { width: 8%; }
.req-table th.col-actions,
.req-table td.col-actions { width: 9%; }
.req-table th {
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  white-space: nowrap;
  border-bottom: 2px solid var(--slate-200);
}
.req-table tr.req-line {
  border-bottom: 1px solid #e2e8f0;
}
.req-table tr.req-line:last-child td {
  border-bottom: none;
}
.req-table tr.req-line:hover {
  background: #f8fafc;
}
.req-prod-name {
  font-weight: 600;
  color: var(--slate-900);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.req-model-text {
  color: var(--slate-700);
  font-size: 0.84rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.req-sku-badge {
  font-family: monospace;
  background: var(--slate-100);
  color: var(--slate-700);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.req-cat-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.cat-edit {
  padding: 0.28rem 0.5rem;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 160px;
  transition: all 0.15s ease;
}
.cat-edit:hover,
.cat-edit:focus {
  border-color: var(--blue-500);
  background: #fff;
  outline: 2px solid rgba(37, 99, 235, 0.25);
}
.req-model-text {
  color: var(--slate-600);
  font-size: 0.82rem;
  white-space: nowrap;
  display: inline-block;
}
.qty-edit {
  width: 72px;
  max-width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--slate-900);
  box-sizing: border-box;
  background: #fff;
  transition: all 0.15s ease;
}
.qty-edit:focus {
  border-color: var(--blue-500);
  outline: 2px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.line-action-btns {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-start;
}
.btn-line-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background: #fff;
  color: var(--slate-700);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-line-edit:hover {
  background: var(--blue-50);
  border-color: #bfdbfe;
  color: var(--blue-700);
}
.btn-line-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-line-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.btn-icon-danger {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--slate-400);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon-danger:hover {
  background: var(--red-50);
  color: var(--red-600);
}
.req-list-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-top: 1px solid var(--slate-200);
  font-size: 0.82rem;
  color: var(--slate-600);
}
.req-list-summary strong {
  color: var(--slate-900);
}

/* Sort bar & mode buttons */
.req-sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--slate-200);
  flex-wrap: wrap;
}
.sort-mode-btns {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.btn-sort-opt {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-600);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sort-opt:hover {
  background: var(--slate-50);
  color: var(--slate-900);
}
.btn-sort-opt.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 700;
}
.btn-finish-order {
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.32rem 0.65rem;
  background: #fff !important;
  color: var(--slate-700) !important;
  border: 1px solid var(--slate-200) !important;
}
.btn-finish-order:hover {
  background: var(--slate-50) !important;
  color: var(--slate-900) !important;
}
tr.req-line.is-recently-added {
  animation: highlightNewRow 2s ease-out;
  background: #eff6ff;
}
@keyframes highlightNewRow {
  0% { background: #dbeafe; }
  100% { background: #ffffff; }
}
.new-item-panel { margin: 0.15rem 0 0.75rem; min-width: 0; }
.new-item-toggle-row { margin-bottom: 0.35rem; }
.new-item-toggle-row .btn-outline,
.new-item-toggle-row .btn-ghost {
  max-width: 100%;
  white-space: nowrap;
  text-align: left;
  height: auto;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font-size: 0.84rem;
  font-weight: 600;
}
.new-item-form {
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--slate-50);
  min-width: 0;
}
.new-item-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.92rem;
}
.ni-cat-select {
  width: 100%;
  padding: 0.52rem 0.7rem;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  background: #fff;
  font-size: 0.88rem;
  color: var(--slate-900);
  font-weight: 600;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.ni-cat-select:focus {
  border-color: var(--blue-500);
  outline: 2px solid rgba(37, 99, 235, 0.2);
}
.new-item-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr 0.45fr;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}

/* Excel Filter Tool Styles */
.excel-dropzone-panel {
  padding: 3.5rem 2rem;
  text-align: center;
  border: 2px dashed var(--slate-300);
  border-radius: 12px;
  background: #fff;
}
.excel-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.excel-dropzone-icon {
  font-size: 3.2rem;
  line-height: 1;
}
.excel-dropzone h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--slate-900);
}
.excel-dropzone-sub {
  color: var(--slate-500);
  max-width: 520px;
  font-size: 0.92rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}
.excel-dropzone.is-dragover {
  outline: 3px solid #2563eb;
  outline-offset: 6px;
  background: #eff6ff;
  border-radius: 12px;
}
.excel-filter-panel {
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Receive from supplier (inside Supplier Converter) */
.sr-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1100px;
}
.sr-flow-note {
  margin: 0;
}
.sr-flow-note strong {
  display: block;
  margin-bottom: 0.45rem;
}
.sr-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--slate-600);
  line-height: 1.55;
  font-size: 0.92rem;
}
.sr-steps li + li {
  margin-top: 0.25rem;
}
.sr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 820px) {
  .sr-grid { grid-template-columns: 1fr; }
  .conv-mode-split.conv-mode-three { grid-template-columns: 1fr; }
}
.sr-drop-single {
  max-width: 640px;
}
.sr-drop-single .sr-dropzone {
  min-height: 240px;
}
.sr-dropzone {
  min-height: 210px;
}
.sr-dropzone.has-file {
  border-color: var(--blue-300);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 70%);
}
.sr-dropzone .excel-dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 auto 0.65rem;
}
.sr-file-name {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--slate-700);
  word-break: break-all;
}
.sr-order-pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sr-order-pick label {
  font-weight: 600;
  font-size: 0.9rem;
}
.sr-order-pick select {
  min-width: 260px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background: #fff;
}
.sr-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.sr-report-summary > div {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sr-report-summary strong {
  font-size: 1.25rem;
  color: var(--slate-900);
}
.sr-report-summary span {
  font-size: 0.78rem;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sr-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.sr-next-hint {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}
.sr-report-block {
  margin-top: 0.85rem;
}
.sr-report-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}
.sr-report-block ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--slate-600);
  font-size: 0.86rem;
  max-height: 180px;
  overflow: auto;
}
.excel-filter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.excel-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.excel-file-info strong {
  font-size: 0.95rem;
  color: var(--slate-900);
}
.excel-file-info span {
  font-size: 0.8rem;
  color: var(--slate-500);
}
.excel-file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.excel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.1rem;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  flex-wrap: wrap;
}
.excel-search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 320px;
  background: #fff;
  border: 1.5px solid var(--blue-500);
  border-radius: 8px;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.excel-search-icon {
  font-size: 0.85rem;
  color: var(--slate-400);
}
.excel-search-box input {
  flex: 1;
  border: none !important;
  outline: none !important;
  padding: 0.35rem 0.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate-900);
  background: transparent;
}
.excel-search-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-700);
  white-space: nowrap;
  padding: 0.2rem 0.55rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
}
.excel-search-nav-group {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.excel-search-nav-btn {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.7rem;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.excel-search-nav-btn:hover {
  background: var(--blue-600);
  color: #fff;
  border-color: var(--blue-600);
}
.excel-sel-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.excel-table-wrap {
  max-height: 540px;
  overflow: auto;
}
.excel-table th,
.excel-table td {
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
}
tr.excel-row.is-selected {
  background: #eff6ff !important;
}
tr.excel-row.is-active-match {
  outline: 2px solid var(--blue-600);
  background: #dbeafe !important;
}
mark.excel-hl {
  background: #fde047;
  color: #854d0e;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 2px;
  box-shadow: 0 0 0 1px #eab308;
}

/* File Storage & History Styles */
.excel-storage-section {
  margin-top: 1.5rem;
}
.excel-storage-header {
  margin-bottom: 1rem;
}
.excel-storage-header h3 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  color: var(--slate-900);
}
.excel-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.excel-history-card {
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.excel-history-card:hover {
  border-color: var(--blue-400);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}
.excel-history-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.excel-history-title-wrap {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.excel-file-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.excel-history-name {
  display: block;
  font-size: 0.92rem;
  color: var(--slate-900);
  word-break: break-all;
}
.excel-history-meta {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin-top: 0.25rem;
}
.excel-history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.excel-history-select {
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  font-size: 0.84rem;
  background: #fff;
  color: var(--slate-900);
  font-weight: 600;
  max-width: 220px;
  cursor: pointer;
}

/* Supplier Invoice Converter Styles */
.conv-mode-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: stretch;
  margin: 0 0 1.15rem;
}
.conv-mode-split.conv-mode-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.conv-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  text-align: left;
  font-family: inherit;
  border: 1px solid var(--slate-200);
  background: #fff;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  color: var(--slate-600);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.conv-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue-300);
}
.conv-mode-card.active {
  border-color: var(--blue-600);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 70%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.16);
  color: var(--slate-900);
  transform: translateY(-3px);
}
.conv-mode-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--slate-100);
  color: var(--slate-500);
  transition: background 0.28s ease, color 0.28s ease;
}
.conv-mode-card.active .conv-mode-num {
  background: var(--blue-600);
  color: #fff;
}
.conv-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.conv-mode-copy strong {
  font-size: 1rem;
  color: var(--slate-900);
}
.conv-mode-copy span {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--slate-500);
}
.conv-mode-or {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 48px;
}
.conv-mode-or::before {
  content: '';
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, #fbbf24, var(--blue-500), #fbbf24, transparent);
  background-size: 100% 200%;
  animation: convOrFlow 2.4s linear infinite;
  border-radius: 99px;
}
.conv-mode-or span {
  position: relative;
  z-index: 1;
  background: #f1f5f9;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
}
@keyframes convOrFlow {
  from { background-position: 0 0; }
  to { background-position: 0 200%; }
}
.conv-stage {
  animation: convStageIn 0.38s ease;
}
@keyframes convStageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.conv-rate-card {
  margin-bottom: 1rem;
}
.conv-top-settings {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.conv-fee-panel {
  margin-bottom: 1rem;
}
.conv-fee-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.conv-fee-search {
  min-width: 180px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  font-size: 0.88rem;
}
.conv-fee-table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}
.conv-fee-table {
  width: 100%;
  margin: 0;
}
.conv-fee-table th:nth-child(2),
.conv-fee-table td:nth-child(2) {
  width: 220px;
}
.conv-fee-edit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.conv-fee-prefix {
  font-weight: 700;
  color: var(--slate-600);
  flex: 0 0 auto;
}
.conv-fee-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--emerald-600);
  min-width: 4.2rem;
  white-space: nowrap;
}
.conv-fee-name {
  letter-spacing: 0.02em;
}
.conv-fee-value {
  font-weight: 800;
  color: var(--slate-800);
}
.conv-fee-input,
.conv-rmb-input {
  width: 100%;
  max-width: 140px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--blue-300);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--slate-900);
}
.conv-fee-table .cell-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
@media (max-width: 820px) {
  .conv-mode-split {
    grid-template-columns: 1fr;
  }
  .conv-mode-or {
    min-height: 28px;
  }
  .conv-mode-or::before {
    top: 50%;
    bottom: auto;
    left: 8%;
    right: 8%;
    width: auto;
    height: 2px;
    transform: none;
    background: linear-gradient(90deg, transparent, #fbbf24, var(--blue-500), #fbbf24, transparent);
    background-size: 200% 100%;
    animation: convOrFlowX 2.4s linear infinite;
  }
}
@keyframes convOrFlowX {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

.conv-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
button.conv-stat-card.conv-cat-open-card {
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 1px solid #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 70%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
button.conv-stat-card.conv-cat-open-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}
.conv-cat-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.conv-cat-filter-bar label {
  font-size: 0.88rem;
  color: #334155;
}
.conv-cat-filter-select {
  min-width: min(320px, 100%);
  max-width: 420px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  background: #fff;
}
.conv-cat-filter-meta {
  font-size: 0.85rem;
  color: #64748b;
}
.conv-sku-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.conv-sku-filter-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.conv-sku-filter-btn:hover { border-color: #cbd5e1; color: #334155; }
.conv-sku-filter-btn.is-on {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.conv-sku-filter-btn.has-need:not(.is-on) {
  border-color: #fcd34d;
  color: #b45309;
}
.conv-sku-filter-btn.has-need.is-on {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
.conv-match-how {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.25;
}
.conv-match-how.conv-match-miss { color: #b45309; }
.conv-row.is-need-sku { background: #fffbeb; }
.conv-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
}
.conv-cat-chip {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.conv-cat-chip span {
  font-weight: 600;
  color: #64748b;
  margin-left: 0.2rem;
}
.conv-cat-chip.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.conv-cat-chip.needs-price:not(.is-active) {
  border-color: #f59e0b;
  background: #fffbeb;
}
.conv-categories-modal-card {
  width: min(920px, 96vw);
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.conv-categories-modal-card .user-modal-header {
  flex-shrink: 0;
}
.conv-categories-modal-card .user-modal-footer {
  flex-shrink: 0;
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid #e2e8f0;
}
.conv-fee-table tr.conv-cat-needs-price {
  background: #fffbeb;
}
.conv-fee-table .cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.conv-stat-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.conv-stat-card.conv-stat-highlight {
  border-color: var(--emerald-400);
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
.conv-stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.conv-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
}
.conv-panel {
  padding: 1.25rem;
}
.conv-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.conv-panel-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  color: var(--slate-900);
}
.conv-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
}
.conv-rp-table-wrap {
  max-height: min(42vh, 420px);
  overflow: auto;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
}
.conv-rp-table {
  table-layout: fixed;
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.conv-rp-table th,
.conv-rp-table td {
  padding: 0.55rem 0.65rem;
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  border-bottom: 1px solid var(--slate-200);
}
.conv-rp-table th.col-sku,
.conv-rp-table td.col-sku { width: 12%; }
.conv-rp-table th.col-prod,
.conv-rp-table td.col-prod { width: 28%; }
.conv-rp-table th.col-cat,
.conv-rp-table td.col-cat { width: 16%; }
.conv-rp-table th.col-qty,
.conv-rp-table td.col-qty { width: 8%; }
.conv-hist-table-wrap {
  max-height: min(58vh, 560px);
  overflow: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.conv-hist-table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.84rem;
  color: #475569;
}
.conv-hist-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.45rem 0.55rem;
}
.conv-hist-table th,
.conv-hist-table td {
  padding: 0.42rem 0.55rem;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid #f1f5f9;
}
.conv-hist-table tbody tr:hover td {
  background: #f8fafc;
}
.conv-hist-table th.col-sku,
.conv-hist-table td.col-sku { width: 12%; color: #0f172a; font-variant-numeric: tabular-nums; }
.conv-hist-table th.col-prod,
.conv-hist-table td.col-prod { width: 34%; white-space: normal; word-break: break-word; color: #334155; }
.conv-hist-table th.col-qty,
.conv-hist-table td.col-qty { width: 8%; text-align: right; font-variant-numeric: tabular-nums; color: #64748b; }
.conv-hist-table td.conv-hist-reason {
  white-space: normal;
  word-break: break-word;
  color: #b91c1c;
  font-size: 0.8rem;
}
.conv-hist-table td.conv-hist-advice {
  white-space: normal;
  word-break: break-word;
  color: #334155;
  font-size: 0.8rem;
}
.conv-hist-now { color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; }
.conv-hist-was { color: #94a3b8; font-size: 0.78rem; margin-left: 0.25rem; }
.conv-hist-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
}
.conv-hist-tag-amber { background: #fff7ed; color: #c2410c; }
.conv-hist-tag-green { background: #f0fdf4; color: #15803d; }
.conv-hist-tag-ok { background: #eff6ff; color: #1d4ed8; }
.conv-hist-tag-slate { background: #f8fafc; color: #64748b; }

.conv-hist-page { display: flex; flex-direction: column; gap: 0.75rem; }
.conv-hist-toolbar { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-end; }
.conv-hist-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .conv-hist-layout { grid-template-columns: 1fr; }
}
.conv-hist-side {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem;
  max-height: min(70vh, 640px);
  overflow: auto;
}
.conv-hist-side-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.25rem 0.4rem 0.5rem;
}
.conv-hist-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  margin-bottom: 0.2rem;
}
.conv-hist-item:hover { background: #fff; }
.conv-hist-item.is-active {
  background: #fff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.conv-hist-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-hist-item-meta { font-size: 0.72rem; color: #94a3b8; margin-top: 0.1rem; }
.conv-hist-item-stats { font-size: 0.72rem; color: #64748b; margin-top: 0.25rem; line-height: 1.35; }
.conv-hist-fail { color: #b91c1c; font-weight: 600; }
.conv-hist-main { min-width: 0; }
.conv-hist-head { margin-bottom: 0.65rem; }
.conv-hist-file {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.conv-hist-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 700px) {
  .conv-hist-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.conv-hist-stat {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: default;
}
button.conv-hist-stat { cursor: pointer; }
button.conv-hist-stat:hover { border-color: #cbd5e1; }
.conv-hist-stat-n {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #0f172a;
}
.conv-hist-stat-l {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.conv-hist-stat-green .conv-hist-stat-n { color: #15803d; }
.conv-hist-stat-blue .conv-hist-stat-n { color: #1d4ed8; }
.conv-hist-stat-purple .conv-hist-stat-n { color: #7e22ce; }
.conv-hist-stat-red .conv-hist-stat-n { color: #b91c1c; }
.conv-hist-fail-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.86rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}
.conv-hist-fail-banner .linkish {
  background: none;
  border: none;
  color: #b91c1c;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.conv-hist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.conv-hist-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.conv-hist-tab:hover { border-color: #cbd5e1; color: #334155; }
.conv-hist-tab.is-on {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.conv-hist-empty-fail {
  padding: 1rem 0.85rem;
  background: #fff7ed;
  border-radius: 8px;
  color: #9a3412;
  line-height: 1.45;
  white-space: normal;
}
.conv-rp-table th.col-sku,
.conv-rp-table td.col-sku { width: 12%; }
.conv-rp-table th.col-prod,
.conv-rp-table td.col-prod { width: 28%; }
.conv-rp-table th.col-cat,
.conv-rp-table td.col-cat { width: 16%; }
.conv-rp-table th.col-qty,
.conv-rp-table td.col-qty { width: 8%; }
.conv-rp-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.84rem;
  background: #fff;
}
.conv-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1280px;
}
.conv-table th,
.conv-table td {
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-table th:nth-child(1),
.conv-table td:nth-child(1) {
  width: 14%;
}
.conv-table th:nth-child(2),
.conv-table td:nth-child(2) {
  width: 9%;
}
.conv-table th:nth-child(3),
.conv-table td:nth-child(3) {
  width: 16%;
}
.conv-table th:nth-child(4),
.conv-table td:nth-child(4) {
  width: 160px;
  min-width: 160px;
  overflow: visible;
  text-overflow: clip;
}
.conv-sku-cell {
  max-width: 180px;
  position: relative;
  overflow: visible;
}
.conv-sku-wrap {
  position: relative;
}
.conv-sku-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--blue-300);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-900);
  background: #f8fafc;
  transition: all 0.15s ease;
}
.conv-sku-input:focus {
  background: #ffffff;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}
.conv-product-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--blue-300);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-900);
  background: #f8fafc;
  transition: all 0.15s ease;
}
.conv-product-input:focus,
.conv-category-select:focus {
  background: #ffffff;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}
.conv-product-cell {
  min-width: 160px;
  max-width: 280px;
}
.conv-category-cell {
  width: 160px;
  min-width: 160px;
  max-width: none;
  overflow: visible;
}
.conv-category-select {
  display: block;
  width: 100%;
  min-width: 148px;
  box-sizing: border-box;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--blue-300);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-900);
  background: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  transition: all 0.15s ease;
}
.conv-sku-suggest {
  position: fixed;
  z-index: 1200;
  min-width: 280px;
  max-width: 380px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  padding: 0.25rem;
}
.conv-sku-suggest.hidden { display: none; }
.conv-sku-suggest-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}
.conv-sku-suggest-item:hover,
.conv-sku-suggest-item.is-active {
  background: #eff6ff;
}
.conv-sku-suggest-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  color: #1e3a8a;
  font-size: 0.78rem;
}
.conv-sku-suggest-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-sku-suggest-src {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.conv-sku-suggest-busy,
.conv-sku-suggest-empty {
  padding: 0.55rem 0.6rem;
  font-size: 0.78rem;
  color: #64748b;
}
tr.conv-row.is-matched {
  background-color: #f0f9ff;
}
tr.conv-row.is-reviewed {
  background-color: #f0fdf4;
}
.conv-supplier-model,
.conv-product-name {
  display: block;
  font-weight: 700;
  color: var(--slate-800);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
}
.conv-product-name {
  color: var(--blue-900);
}
.conv-table-preview {
  background: #ffffff;
}
.new-item-form input {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: #fff;
  box-sizing: border-box;
}
.modal-foot {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--slate-200);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  flex-shrink: 0;
  min-width: 0;
}
.req-foot {
  width: 100%;
  box-sizing: border-box;
}
.req-foot .foot-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--red-600);
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}
.foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-800);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.btn-outline:hover { background: var(--slate-50); }
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: none;
  background: var(--red-600);
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
}
.btn-accent:hover { background: var(--red-700); }
.btn-accent.is-submitted,
.btn-accent.is-submitted:disabled {
  background: #16a34a;
  color: #fff;
  cursor: default;
  opacity: 1;
}
.req-table-card.req-locked {
  opacity: 0.92;
}
.req-table-card.req-locked input,
.req-table-card.req-locked select,
.req-table-card.req-locked textarea {
  background: #f8fafc;
  cursor: not-allowed;
}
.req-foot .btn-ghost {
  border: none;
  background: transparent;
  color: var(--slate-700);
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
}
.req-foot .btn-ghost:hover { background: var(--slate-100); }
.line-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.55fr auto;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.line-row input, .modal-body input, .modal-body select {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  background: #fff;
  color: var(--slate-900);
  box-sizing: border-box;
}
.line-row input:focus, .modal-body input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--blue-500);
}
.saved-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ok);
  font-weight: 600;
}
.saved-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--slate-500);
}

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


@media (max-width: 1080px) {
  .auth-screen {
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .auth-visual {
    min-height: 0;
    padding: 0.85rem 1.1rem;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  .auth-visual .auth-hero,
  .auth-visual .auth-foot-note {
    display: none !important;
  }
  .brand-title-desk,
  .auth-visual .brand-sub {
    display: none;
  }
  .brand-title-mob {
    display: block;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }
  .brand-mark {
    justify-content: center;
    gap: 0.7rem;
  }
  .auth-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0.85rem 1rem 0.75rem;
    min-height: 0;
  }
  .auth-card {
    width: 100%;
    max-width: none;
    padding: 1.25rem 1.05rem 1.15rem;
    flex: 1;
  }
  .auth-foot-login {
    display: block;
    text-align: center;
    color: var(--slate-500);
    margin-top: 0.85rem;
    padding-bottom: 0.35rem;
  }
  .auth-foot-login .auth-foot-version {
    display: block;
    color: var(--slate-600);
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .clock {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
  }
  .stats { grid-template-columns: 1fr 1fr; }
  .split-2 { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 1fr; }
  .new-item-grid { grid-template-columns: 1fr 1fr; }
  .req-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .foot-actions {
    margin-left: 0;
    width: 100%;
  }
  .foot-actions .btn-outline,
  .foot-actions .btn-accent,
  .foot-actions .btn-ghost {
    flex: 0 0 auto;
    width: fit-content;
  }
  .action-row .btn-primary,
  .action-row .btn-secondary {
    flex: 1 1 auto;
  }

  .req-workspace {
    grid-template-columns: 1fr !important;
  }
  .req-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    max-height: none;
  }
  .req-side-brand {
    padding: 0.2rem 0.35rem;
  }
  .req-side-tag { display: none; }
  .req-side-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    gap: 0.3rem;
  }
  .req-side-btn {
    flex: 0 0 auto;
    width: auto;
    align-items: center;
    padding: 0.4rem 0.55rem;
  }
  .req-side-text small { display: none; }
  .req-side-summary { display: none; }
  .req-side-close {
    width: auto;
    margin-left: auto;
  }
  .req-top,
  .req-tabs,
  .req-content,
  .req-workspace .req-foot {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .req-top {
    padding-top: 1.1rem;
    padding-bottom: 0.95rem;
  }
}

@media (max-width: 640px) {
  .demo-banner { font-size: 0.68rem; padding: 0.35rem 0.55rem; }
  .stats { grid-template-columns: 1fr; }
  .stat .val { font-size: 1.4rem; }
  .main { padding: 0.85rem 0.7rem 1.5rem; }
  .panel-head { padding: 0.75rem 0.85rem; }
  .panel-note { width: 100%; }
  .action-row { flex-direction: column; }
  .action-row .btn-primary,
  .action-row .btn-secondary { width: 100%; }
  .app-toast {
    left: 0.75rem;
    right: 0.75rem;
    top: 2.4rem;
    bottom: auto;
    transform: none;
    max-width: none;
    width: auto;
  }

  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table th,
  .responsive-table td,
  .responsive-table tr {
    display: block;
    width: 100%;
  }
  .responsive-table thead { display: none; }
  .responsive-table tr.data-row {
    border-bottom: 1px solid var(--slate-200);
    padding: 0.75rem 0.9rem;
  }
  .responsive-table tr.data-row:last-child { border-bottom: 0; }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: none;
    text-align: right;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--slate-500);
    text-align: left;
    flex-shrink: 0;
  }
  .responsive-table td.cell-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .req-head p { max-width: none; font-size: 0.78rem; }
  .search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .search-wrap { width: 100%; }
  .qty-add-group {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  .qty-add-group .qty-input { width: 100%; }
  .qty-add-group .btn-add-line { width: 100%; }
  .search-hit {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .hit-add { align-self: flex-end; }
  .new-item-grid { grid-template-columns: 1fr; }
  .foot-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .foot-actions .btn-outline,
  .foot-actions .btn-accent,
  .foot-actions .btn-ghost {
    width: fit-content;
    max-width: 100%;
  }

  .req-list-box.has-items {
    border: none;
    background: transparent;
    overflow: visible;
    box-shadow: none;
  }
  .req-list-box .table-wrap { overflow: visible; }
  .req-list-box .req-table,
  .req-list-box thead,
  .req-list-box tbody,
  .req-list-box th,
  .req-list-box td,
  .req-list-box tr {
    display: block;
    width: 100%;
  }
  .req-list-box thead { display: none; }
  .req-list-box tr.req-line {
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.85rem;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  }
  .req-list-box td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--slate-100);
    text-align: right;
  }
  .req-list-box td:last-child { border-bottom: none; }
  .req-list-box td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--slate-500);
    text-align: left;
    flex-shrink: 0;
  }
  .req-list-box td.line-actions { justify-content: flex-end; }
  .req-list-box td.line-actions::before { content: none; }
  .qty-edit { width: 76px; }
  .req-list-summary {
    border-radius: 8px;
    margin-top: 0.5rem;
  }
}

/* Price gaps (POS missing wholesale / special / super) */
.pg-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.65rem;
}
.pg-tally {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  color: var(--slate-600);
  font-size: 0.86rem;
  line-height: 1.45;
}
.pg-tally strong { color: var(--slate-800); }
.pg-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.pg-filter strong { font-size: 0.92rem; }
.pg-filter span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-800);
}
.pg-filter.active {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.qg-load-box {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.qg-load-title {
  margin: 0;
  font-weight: 650;
  color: var(--slate-800);
}
.qg-load-detail {
  margin: 0.35rem 0 0.65rem;
  color: var(--slate-500);
  font-size: 0.9rem;
}
.qg-load-track {
  height: 8px;
  border-radius: 999px;
  background: var(--slate-200);
  overflow: hidden;
}
.qg-load-bar {
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  transition: width 0.6s ease;
}
.qg-places-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--slate-700);
}
.qg-place-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
}
.qg-sel-count {
  font-size: 0.84rem;
  color: var(--slate-600);
}
.qg-places {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.85rem;
}
.qg-place {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.qg-place:hover { border-color: var(--blue-400); }
.qg-place.active {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.qg-place.selected {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.qg-place.has-gaps {
  border-color: #f59e0b;
}
.qg-place.has-gaps.active {
  border-color: var(--blue-500);
}
.qg-place-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  width: fit-content;
}
.qg-place-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.15rem 0 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}
.qg-place strong { font-size: 0.9rem; }
.qg-place-code {
  font-size: 0.72rem;
  color: var(--slate-500);
  text-transform: uppercase;
}
.qg-place-stat {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-800);
  margin-top: 0.15rem;
}
.qg-place-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
}
.pg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.pg-auto-toggle {
  margin: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
.pg-markup-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--slate-700);
  white-space: nowrap;
}
.pg-markup-input {
  width: 72px;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.pg-fill-cols {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--slate-600);
}
.pg-search {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font: inherit;
}
.prod-sync-monitor {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: 0.82rem;
  font-weight: 600;
}
.prod-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  flex: 0 0 auto;
}
.prod-page {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.prod-section {
  margin: 0 0 1rem;
}
.prod-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-500);
  margin: 0 0 0.45rem;
}
.prod-price-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}
.prod-price-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  background: #fff;
  cursor: pointer;
  font: inherit;
  min-height: 104px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.prod-price-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.prod-price-card.tone-amber { border-top: 3px solid #f59e0b; }
.prod-price-card.tone-sky { border-top: 3px solid #0ea5e9; }
.prod-price-card.tone-violet { border-top: 3px solid #8b5cf6; }
.prod-price-card.tone-rose { border-top: 3px solid #f43f5e; }
.prod-price-card.tone-slate { border-top: 3px solid #64748b; }
.prod-price-card.has-gaps {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 72%);
}
.prod-price-card.tone-sky.has-gaps { background: linear-gradient(180deg, #f0f9ff 0%, #fff 72%); }
.prod-price-card.tone-violet.has-gaps { background: linear-gradient(180deg, #f5f3ff 0%, #fff 72%); }
.prod-price-card.tone-rose.has-gaps { background: linear-gradient(180deg, #fff1f2 0%, #fff 72%); }
.prod-price-card.tone-slate.has-gaps { background: linear-gradient(180deg, #f8fafc 0%, #fff 72%); }
.prod-price-card.active {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.prod-price-card-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prod-price-card-count {
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--slate-900);
  font-weight: 800;
}
.prod-price-card-hint {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: auto;
}
.prod-tools-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.75rem;
}
.prod-tools-grid.prod-tools-single {
  grid-template-columns: 1fr;
}
.prod-name-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
}
.prod-name-text {
  min-width: 0;
  flex: 1 1 auto;
}
.prod-move-ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 0.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.prod-move-ico:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.prod-move-modal-overlay .prod-move-modal-card {
  max-width: 1080px;
  width: min(1080px, 96vw);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
}
.prod-move-modal-card .user-modal-header {
  padding: 0.85rem 1.1rem;
}
.prod-move-modal-card .user-modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prod-move-modal-card .user-modal-header .sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.2rem;
}
.prod-move-modal-card .user-modal-footer {
  padding: 0.7rem 1.1rem;
}
.prod-move-modal-body {
  gap: 0.85rem;
  overflow: auto;
  flex: 1 1 auto;
  font-size: 0.82rem;
  line-height: 1.35;
}
.prod-move-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
}
.prod-move-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.7fr);
  gap: 0.75rem;
  align-items: stretch;
}
.prod-move-balances-card {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.prod-move-balances-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f1f5f9;
}
.prod-move-balances-head strong {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}
.prod-move-balances-head span {
  font-size: 0.72rem;
  color: #94a3b8;
}
.prod-move-balances-table,
.prod-move-ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.prod-move-balances-table th,
.prod-move-balances-table td,
.prod-move-ledger-table th,
.prod-move-ledger-table td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}
.prod-move-balances-table th,
.prod-move-ledger-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  background: #f8fafc;
  font-weight: 700;
  border-bottom: 1px solid #cbd5e1;
}
.prod-move-balances-table tr:last-child td,
.prod-move-ledger-table tr:last-child td {
  border-bottom: none;
}
.prod-move-qty-cell {
  text-align: right !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  white-space: nowrap;
}
.prod-move-stat-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 88%);
}
.prod-move-stat {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}
.prod-move-stat span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.prod-move-stat strong {
  font-size: 1.15rem;
  font-weight: 750;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.prod-move-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  align-items: flex-end;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.prod-move-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.prod-move-filter span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.prod-move-filter select,
.prod-move-filter input[type="date"] {
  min-height: 34px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
  color: #0f172a;
}
.prod-move-filter select { min-width: 11.5rem; }
.prod-move-filter input[type="date"] { min-width: 9.5rem; }
.prod-move-timeline-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.1rem;
}
.prod-move-timeline-head strong {
  font-size: 0.82rem;
  color: #0f172a;
}
.prod-move-timeline-head span {
  font-size: 0.72rem;
  color: #64748b;
}
.prod-move-day {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.65rem;
}
.prod-move-day:last-child { margin-bottom: 0; }
.prod-move-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
}
.prod-move-day-head strong {
  font-size: 0.8rem;
  color: #1e3a8a;
}
.prod-move-day-head span {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}
.prod-move-ledger-table .prod-move-time {
  width: 4.5rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.prod-move-ledger-table .prod-move-route {
  color: #0f172a;
  font-weight: 560;
}
.prod-move-arrow {
  color: #2563eb;
  font-weight: 700;
  margin: 0 0.2rem;
}
.prod-move-ledger-table .prod-move-type {
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
}
.prod-move-ledger-table tr.is-transfer td { background: #f8fbff; }
.prod-move-ledger-table tr.is-received td { background: #f0fdf4; }
.prod-move-ledger-table tr.is-adjusted td,
.prod-move-ledger-table tr.is-damaged td { background: #fffbeb; }
.prod-move-ledger-table tr.is-returned td { background: #f5f3ff; }
.prod-move-ledger-table tr.is-sold td { background: #fff1f2; }
.prod-move-empty {
  padding: 1.1rem 0.9rem;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  font-size: 0.8rem;
  background: #f8fafc;
}
.prod-move-row.is-transfer { border-color: #bfdbfe; background: linear-gradient(180deg, #eff6ff 0%, #fff 85%); }
.prod-move-row.is-sold { border-color: #fecdd3; background: linear-gradient(180deg, #fff1f2 0%, #fff 85%); }
.prod-move-row.is-received { border-color: #a7f3d0; background: linear-gradient(180deg, #ecfdf5 0%, #fff 85%); }
.prod-move-row.is-adjusted { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb 0%, #fff 85%); }
.prod-move-row.is-returned { border-color: #ddd6fe; background: linear-gradient(180deg, #f5f3ff 0%, #fff 85%); }
.prod-move-row.is-damaged { border-color: #fdba74; background: linear-gradient(180deg, #fff7ed 0%, #fff 85%); }
@media (max-width: 800px) {
  .prod-move-top-grid { grid-template-columns: 1fr; }
  .prod-move-filter select,
  .prod-move-filter input[type="date"] { min-width: 0; width: 100%; }
  .prod-move-filters { flex-direction: column; align-items: stretch; }
  .prod-move-day-head { flex-direction: column; align-items: flex-start; }
}
.prod-tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid var(--slate-200);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  text-align: left;
  font: inherit;
}
button.prod-tool-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
button.prod-tool-card:hover,
.prod-move-launch.active {
  transform: translateY(-1px);
  border-color: var(--blue-500);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}
.prod-tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.prod-tool-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--slate-900);
}
.prod-tool-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--slate-500);
  line-height: 1.35;
}
.prod-tool-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 800;
  flex: 0 0 auto;
}
.prod-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.prod-tool-select {
  flex: 1 1 180px;
  min-width: 160px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  font: inherit;
  background: var(--slate-50);
}
.prod-tool-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--slate-500);
}
.prod-move-launch-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
}
.prod-move-launch-body strong {
  font-size: 0.92rem;
  color: var(--slate-900);
}
.prod-move-launch-body span {
  font-size: 0.78rem;
  color: var(--slate-500);
}
.prod-add-panel {
  margin: 0;
}
.user-modal-card.prod-add-modal-card {
  max-width: 1180px;
  width: min(1180px, 97vw);
  max-height: min(94vh, 940px);
}
.prod-add-modal-body {
  gap: 1.15rem;
  padding: 1.35rem 1.55rem;
  max-height: min(72vh, 720px);
  overflow: auto;
}
.prod-add-modal-grid {
  grid-template-columns: 1fr 1.35fr;
  gap: 0.95rem 1.05rem;
  align-items: start;
}
.prod-add-modal-grid .prod-field-wide {
  grid-column: 1 / -1;
}
.prod-add-modal-grid .prod-field-sku {
  grid-column: 1 / -1;
}
.prod-add-stock-block {
  padding: 1.05rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 88%);
}
.prod-add-stock-block .prod-section-label {
  margin-bottom: 0.25rem;
}
.prod-add-stock-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}
.prod-add-modal-stock {
  grid-template-columns: 1.4fr 0.7fr 0.9fr;
  gap: 0.85rem 0.8rem;
}
.prod-recent-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.prod-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.prod-recent-head strong {
  font-size: 0.82rem;
  color: #0f172a;
}
.prod-recent-head span {
  font-size: 0.75rem;
  color: #64748b;
}
.prod-recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.prod-recent-table th,
.prod-recent-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}
.prod-recent-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  font-weight: 700;
}
.prod-recent-table tr:last-child td { border-bottom: none; }
.prod-recent-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  color: #1e3a8a;
}
.prod-recent-empty {
  padding: 1rem;
  color: #64748b;
  font-size: 0.82rem;
  margin: 0;
}
.prod-recent-qty-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.prod-recent-qty-input {
  width: 4.5rem;
  min-height: 32px;
  padding: 0.25rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
}
.prod-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.user-modal-card.prod-catmap-modal-card {
  max-width: 640px;
  width: min(640px, 96vw);
  max-height: min(90vh, 820px);
}
.prod-catmap-modal-body {
  gap: 0.75rem;
  overflow: auto;
  max-height: min(62vh, 560px);
}
.prod-catmap-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.prod-catmap-legend span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.prod-catmap-legend .is-main {
  background: #dbeafe;
  color: #1e40af;
}
.prod-catmap-legend .is-hq {
  background: #ffedd5;
  color: #9a3412;
}
.prod-catmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.prod-catmap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.prod-catmap-name {
  font-size: 0.84rem;
  font-weight: 650;
  color: #0f172a;
  min-width: 0;
}
.prod-catmap-radios {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.prod-catmap-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  background: #f8fafc;
}
.prod-catmap-radio.is-main:has(input:checked) {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1e40af;
}
.prod-catmap-radio.is-hq:has(input:checked) {
  border-color: #fdba74;
  background: #ffedd5;
  color: #9a3412;
}
.prod-drawer-line {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}
.prod-drawer-line strong {
  color: #0f172a;
  font-weight: 700;
}
.prod-drawer-empty {
  color: #94a3b8;
  font-style: italic;
}
.prod-col-drawer {
  min-width: 7.5rem;
  white-space: nowrap;
}
.prod-drawer-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.prod-drawer-chip {
  display: inline-flex;
  align-items: center;
  max-width: 9rem;
  padding: 0.18rem 0.45rem;
  border-radius: 7px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-catalog-table thead th.prod-col-drawer {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
}
.prod-qty-ico,
.prod-drawer-ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 0.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.prod-qty-ico:hover,
.prod-drawer-ico:hover {
  background: #ffedd5;
  border-color: #fb923c;
  transform: translateY(-1px);
}
.prod-drawer-ico {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #b45309;
  margin-top: 0;
}
.prod-drawer-ico:hover {
  background: #fef3c7;
  border-color: #fbbf24;
}
.user-modal-card.prod-drawer-modal-card {
  max-width: 440px;
  width: min(440px, 94vw);
}
.prod-drawer-modal-body {
  gap: 0.85rem;
}
.prod-cd-modal-overlay {
  padding: 0.45rem;
  align-items: stretch;
  justify-content: center;
}
.user-modal-card.prod-cd-modal-card {
  max-width: min(1480px, 99vw);
  width: 99vw;
  height: 96vh;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  border-radius: 16px;
}
.prod-cd-modal-header {
  padding-top: 0.85rem;
  padding-bottom: 0.55rem;
}
.prod-cd-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.prod-cd-modal-header .sub {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
}
.prod-cd-modal-body {
  flex: 1 1 auto;
  overflow: auto;
  padding-top: 0.35rem;
  gap: 0.85rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f1f5f9 0%, #eef2ff 48%, #f8fafc 100%);
}
.prod-cd-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
.prod-cd-panel.is-active {
  display: flex;
  animation: cdPanelIn 0.28s ease-out;
}
.prod-cd-modal-body:not(.is-check-tab) .prod-cd-section {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 242, 255, 0.75) 100%);
  border: 1px solid rgba(199, 210, 254, 0.7);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 0.35rem;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.06);
  backdrop-filter: blur(6px);
  animation: cdPanelIn 0.35s ease-out;
}
@keyframes cdPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cdRowIn {
  from { opacity: 0; transform: translateY(10px); background-color: rgba(219, 234, 254, 0.55); }
  to { opacity: 1; transform: translateY(0); background-color: transparent; }
}
@keyframes cdCardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cd-rev-filter {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cbd5e1;
  color: #475569;
  font-weight: 700;
}
.cd-rev-filter.is-on {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.22);
}
.cd-rev-table-shell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(191, 219, 254, 0.85);
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(147, 197, 253, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 70% at 0% 100%, rgba(196, 181, 253, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(239, 246, 255, 0.9));
}
.cd-rev-table-wrap {
  margin: 0;
  border: 0;
  background: transparent;
  max-height: min(58vh, 640px);
  overflow: auto;
}
.cd-rev-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.cd-rev-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(241, 245, 249, 0.94);
  backdrop-filter: blur(8px);
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.cd-rev-table tbody tr.cd-rev-row {
  animation: cdRowIn 0.42s ease-out both;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.cd-rev-table tbody tr.cd-rev-row td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.55);
}
.cd-rev-table tbody tr.cd-rev-row:nth-child(even) td {
  background: rgba(239, 246, 255, 0.55);
}
.cd-rev-table tbody tr.cd-rev-row:hover td {
  background: rgba(219, 234, 254, 0.78);
}
.cd-rev-table tbody tr.cd-rev-row.is-syncing td {
  background: rgba(254, 243, 199, 0.7);
}
.cd-rev-sku {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  letter-spacing: 0.03em;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
  text-decoration: none;
}
.cd-rev-when {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
.cd-rev-shop {
  color: #0f172a;
  font-size: 0.9rem;
}
.cd-rev-product {
  color: #334155;
  font-weight: 600;
  line-height: 1.35;
}
.cd-rev-by {
  color: #64748b;
  font-weight: 600;
  font-size: 0.86rem;
}
.cd-rev-loc {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.cd-rev-loc-from {
  background: rgba(241, 245, 249, 0.95);
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.cd-rev-loc-to {
  background: rgba(220, 252, 231, 0.95);
  color: #15803d;
  border: 1px solid #86efac;
}
.cd-rev-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
  max-width: none;
}
.cd-rev-pill-new {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.cd-rev-pill-change {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.cd-rev-pill-clear {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.cd-rev-pill-updated {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.cd-rev-pill-pending {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}
.cd-rev-branch-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.cd-rev-branch-card {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  animation: cdCardIn 0.4s ease-out both;
}
.cd-rev-branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e8eef7;
  background: rgba(239, 246, 255, 0.65);
}
.cd-rev-branch-title {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}
.cd-rev-branch-title strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
}
.cd-rev-branch-sub {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}
.cd-rev-branch-check,
.cd-rev-item-check {
  display: flex;
  align-items: center;
  margin-top: 0.15rem;
}
.cd-rev-branch-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cd-rev-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem 0.75rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eef2f7;
  animation: cdRowIn 0.35s ease-out both;
}
.cd-rev-item:last-child {
  border-bottom: 0;
}
.cd-rev-item.is-updated {
  background: rgba(240, 253, 244, 0.55);
}
.cd-rev-item.is-syncing {
  background: rgba(254, 243, 199, 0.7);
}
.cd-rev-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.cd-rev-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
}
.cd-rev-arrow {
  color: #94a3b8;
  font-weight: 800;
}
@media (max-width: 720px) {
  .cd-rev-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .cd-rev-item .cd-rev-actions {
    grid-column: 1 / -1;
  }
}
.cd-rev-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cd-rev-empty-row td {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.cd-rev-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2.75rem 1.25rem;
  text-align: center;
  color: #64748b;
  animation: cdPanelIn 0.4s ease-out;
}
.cd-rev-empty-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  filter: grayscale(0.15);
  opacity: 0.85;
}
.cd-rev-empty strong {
  color: #0f172a;
  font-size: 1.02rem;
}
.cd-rev-empty span {
  max-width: 340px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.cd-rev-lastmsg {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .prod-cd-panel.is-active,
  .prod-cd-modal-body:not(.is-check-tab) .prod-cd-section,
  .cd-rev-table tbody tr.cd-rev-row,
  .cd-user-card,
  .cd-rev-empty {
    animation: none !important;
  }
  .cd-user-card:hover { transform: none; }
}
.prod-cd-modal-body.is-check-tab {
  overflow: hidden;
  padding-top: 0.2rem;
}
.prod-cd-modal-body.is-check-tab .prod-cd-panel.is-active {
  min-height: 0;
}
.prod-cd-modal-body.is-check-tab .prod-cd-section {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}
.prod-cd-modal-body.is-check-tab .prod-cd-section-head {
  padding: 0 0.15rem 0.55rem;
}
.prod-cd-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex: 0 0 auto;
}
.prod-cd-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  padding: 0.7rem 0.85rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.prod-cd-tab.is-active {
  color: #0f172a;
  border-bottom-color: #f59e0b;
}
.prod-cd-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.prod-cd-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.prod-cd-review-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.prod-cd-phone-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(165deg, #eef2ff 0%, #f1f5f9 42%, #e0e7ff 100%);
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
.prod-cd-phone-frame {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: transparent;
}
.prod-cd-modal-body.is-check-tab .prod-cd-phone-frame {
  min-height: 0;
}
.panel .prod-cd-section,
.prod-page .prod-cd-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.85rem;
}
#prodCdModalHost {
  position: relative;
  z-index: 80;
}
.user-modal-card.prod-qty-modal-card {
  max-width: 440px;
  width: min(440px, 94vw);
}
.prod-qty-modal-body {
  gap: 0.85rem;
}
.prod-qty-modal-branch {
  margin: 0;
  font-size: 0.84rem;
  color: #475569;
}
.prod-qty-modal-status {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  text-align: center;
}
.prod-qty-modal-status.is-updating {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.prod-qty-modal-status.is-done {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.prod-qty-modal-status.is-error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}
.prod-field-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: #0f172a;
}
.prod-field-select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.prod-sku-status {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}
.prod-sku-status.is-ok {
  color: #047857;
}
.prod-sku-status.is-bad {
  color: #be123c;
}
.prod-sku-status.is-busy {
  color: #b45309;
}
.prod-add-price-block {
  padding: 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 80%);
}
.prod-add-modal-prices {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem 0.8rem;
}
.prod-add-modal-card .prod-field input,
.prod-add-modal-card .prod-field-select {
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
}
.prod-add-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem 0.7rem;
  align-items: end;
}
.prod-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.prod-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.prod-field input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.prod-field input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.prod-field-wide {
  grid-column: span 2;
}
.prod-add-actions {
  display: flex;
  gap: 0.45rem;
  align-items: end;
  grid-column: span 2;
}
.prod-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 180px;
}
.prod-search-ico {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.95rem;
  pointer-events: none;
}
.prod-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font: inherit;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.prod-search-wrap.pulsing .prod-search-input,
.prod-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.prod-qty-quality .prod-qty-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
}
.prod-qty-stat-card.has-gaps {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 70%);
}
.prod-move-card-wrap {
  margin: 0;
}
.prod-move-hits {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.prod-move-hit {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.prod-move-hit.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
  background: #eff6ff;
}
.prod-move-selected h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
}
.prod-move-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.65rem 0 0.9rem;
}
.prod-move-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  font-size: 0.82rem;
}
.prod-move-timeline {
  display: grid;
  gap: 0.55rem;
}
.prod-move-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 80%);
}
.prod-move-qty {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
@media (max-width: 1100px) {
  .prod-price-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod-tools-grid { grid-template-columns: 1fr; }
  .prod-add-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod-field-wide,
  .prod-add-actions { grid-column: span 3; }
  .prod-add-modal-prices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prod-add-modal-stock { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .prod-price-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod-add-grid { grid-template-columns: 1fr 1fr; }
  .prod-field-wide,
  .prod-add-actions { grid-column: span 2; }
  .prod-add-modal-grid { grid-template-columns: 1fr; }
  .prod-add-modal-grid .prod-field-wide { grid-column: span 1; }
  .prod-add-modal-prices { grid-template-columns: 1fr 1fr; }
  .prod-add-modal-stock { grid-template-columns: 1fr; }
  .prod-qty-quality .prod-qty-stat-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
.prod-catalog-panel {
  overflow: hidden;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--slate-200);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.prod-catalog-panel .pg-toolbar {
  margin-bottom: 0.85rem;
  gap: 0.65rem;
}
.prod-catalog-panel .pg-count {
  margin: 0 0 0.9rem;
}
.prod-catalog-panel .table-wrap {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  overflow: auto;
  background: #fff;
}
.prod-catalog-panel .pg-pager {
  margin-top: 0.95rem;
  padding-top: 0.15rem;
}
.prod-catalog-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.88rem;
}
.prod-catalog-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #eef4ff 0%, #e8eef9 100%);
  border-bottom: 2px solid #c7d7f5;
  border-right: 1px solid #dbe4f3;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
  font-weight: 800;
  padding: 0.78rem 0.8rem;
  white-space: nowrap;
}
.prod-catalog-table thead th:last-child {
  border-right: none;
}
.prod-catalog-table thead th.prod-col-sku { background: linear-gradient(180deg, #ecfeff 0%, #e0f2fe 100%); color: #0e7490; }
.prod-catalog-table thead th.prod-col-cost { background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%); color: #475569; }
.prod-catalog-table thead th.prod-col-retail { background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); color: #1d4ed8; }
.prod-catalog-table thead th.prod-col-wholesale { background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%); color: #b45309; }
.prod-catalog-table thead th.prod-col-special { background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%); color: #6d28d9; }
.prod-catalog-table thead th.prod-col-super { background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%); color: #be123c; }
.prod-catalog-table thead th.prod-col-status { background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%); color: #047857; }
.prod-catalog-table tbody td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
  color: #0f172a;
  background: #fff;
}
.prod-catalog-table tbody td:last-child {
  border-right: none;
}
.prod-catalog-table tbody tr.is-alt td {
  background: #f8fafc;
}
.prod-catalog-table tbody tr:hover td {
  background: #eff6ff !important;
}
.prod-catalog-table tbody tr:hover td.prod-col-retail { background: #dbeafe !important; }
.prod-catalog-table tbody tr:hover td.prod-col-wholesale { background: #fef3c7 !important; }
.prod-catalog-table tbody tr:hover td.prod-col-special { background: #ede9fe !important; }
.prod-catalog-table tbody tr:hover td.prod-col-super { background: #ffe4e6 !important; }
.prod-col-name .pg-name {
  font-weight: 700;
  color: #0f172a;
}
.prod-col-name .pg-meta {
  margin-top: 0.15rem;
  color: #64748b;
  font-size: 0.78rem;
}
.prod-sku-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #0e7490;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.prod-col-cat {
  font-weight: 600;
  color: #334155;
}
.prod-col-pos {
  color: #64748b;
  font-size: 0.82rem;
}
.prod-price-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.prod-col-cost { color: #475569; background: #f8fafc !important; }
.prod-col-retail { color: #1d4ed8; background: #f8fbff !important; }
.prod-col-wholesale { color: #b45309; background: #fffdf7 !important; }
.prod-col-special { color: #6d28d9; background: #faf8ff !important; }
.prod-col-super { color: #be123c; background: #fff8f9 !important; }
.prod-catalog-table tbody tr.is-alt td.prod-col-cost { background: #f1f5f9 !important; }
.prod-catalog-table tbody tr.is-alt td.prod-col-retail { background: #eff6ff !important; }
.prod-catalog-table tbody tr.is-alt td.prod-col-wholesale { background: #fffbeb !important; }
.prod-catalog-table tbody tr.is-alt td.prod-col-special { background: #f5f3ff !important; }
.prod-catalog-table tbody tr.is-alt td.prod-col-super { background: #fff1f2 !important; }
.prod-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.prod-col-action .btn {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}
.prod-col-action .btn:hover {
  background: #dbeafe;
}
.prod-catalog-table thead th.is-edit-col {
  box-shadow: inset 0 -3px 0 #2563eb;
  color: #1d4ed8 !important;
}
.prod-price-edit-cell {
  min-width: 118px;
  background: #eff6ff !important;
}
.prod-catalog-table tbody tr.is-alt td.prod-price-edit-cell {
  background: #dbeafe !important;
}
.prod-price-edit-input {
  width: 100%;
  min-width: 96px;
  padding: 0.45rem 0.55rem;
  border: 1.5px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  color: #1d4ed8;
}
.prod-price-edit-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.pg-count {
  margin: 0 0 0.75rem;
  color: var(--slate-600);
  font-size: 0.88rem;
}
.pg-sync {
  color: var(--slate-700);
  font-weight: 600;
}
.pg-row-status {
  display: inline-block;
  min-width: 3.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  vertical-align: middle;
  margin-right: 0.25rem;
}
.pg-row-status-busy { color: #b45309; }
.pg-row-status-ok { color: #047857; }
.pg-row-status-err { color: #b91c1c; cursor: pointer; }
.pg-progress {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-size: 0.9rem;
}
.pg-progress code {
  font-size: 0.85em;
  background: rgba(255,255,255,0.7);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.pg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.pg-table th {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 2px solid var(--slate-200);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate-500);
}
.pg-table td {
  padding: 0.45rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}
.pg-name { font-weight: 600; color: var(--slate-900); }
.pg-meta { font-size: 0.78rem; color: var(--slate-500); margin-top: 0.15rem; }
.pg-retail { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-input {
  width: 100%;
  min-width: 72px;
  max-width: 110px;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.pg-input.pg-miss {
  background: #fff8e6;
  border-color: #e6c35c;
}
.pg-badge {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  margin-right: 0.15rem;
  border-radius: 4px;
  background: #fff3cd;
  color: #7a5b00;
  font-size: 0.68rem;
  font-weight: 700;
}
.pg-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.pg-empty {
  padding: 1.25rem 1.35rem;
}
.pg-empty .sub { color: var(--slate-500); margin-top: 0.5rem; }
button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue-600);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
@media (max-width: 900px) {
  .pg-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  .aside-user { display: none; }
}

/* Animated UI Styles for Pewang Category, Stock Count & Requisitions Storage */
.animated-card {
  animation: fadeInSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.animated-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}
@keyframes fadeInSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
}
.stock-count-input {
  width: 90px;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s ease;
}
.stock-count-input:focus {
  border-color: #10b981;
  background: #f0fdf4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.badge-saved-pulse {
  background: #10b981;
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  animation: pulseGlow 1.8s infinite;
}
.staff-only-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}
.cat-pill-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cat-pill-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.cat-pill-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.req-attachment-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}
.req-attachment-zone:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s ease;
}
.file-chip:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #f0f7ff;
}

/* Standard Category Cards Grid UI (Matching Inventory Cleanup) */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.category-card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.22s ease-in-out;
  cursor: pointer;
  position: relative;
}
.category-card-box:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 12px 24px -6px rgba(59, 130, 246, 0.18);
}
.category-card-box.active {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.category-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e3a8a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.category-card-count {
  font-size: 1.85rem;
  font-weight: 800;
  color: #2563eb;
  line-height: 1.1;
  margin-bottom: 0.2rem;
}
.category-card-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.85rem;
}
.category-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.category-card-box:hover .category-card-btn {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ==========================================================================
   DELJU INVENTORY DESIGN SYSTEM — STOCK COUNT MODULE (LIGHT THEME)
   ========================================================================== */
.sc-page-container {
  background: #f8fafc;
  min-height: 100%;
  color: #0f172a;
  max-width: 100%;
  min-width: 0;
}

.sc-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 0.25rem;
}

.sc-new-items-table-card {
  padding: 0 !important;
  overflow: hidden;
  max-width: 100%;
}

.sc-new-items-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sc-new-items-table th {
  white-space: nowrap;
}

@media (max-width: 1480px) {
  .sc-col-optional {
    display: none;
  }
}

.sc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-color: #cbd5e1;
}

.sc-card-flat {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem;
}

.sc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sc-pill-active { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.sc-pill-approved { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.sc-pill-synced { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.sc-pill-pending { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.sc-pill-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.sc-pill-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.sc-pill-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border: none;
  cursor: pointer;
  box-shadow: none;
}

.sc-btn-primary { background: #2563eb; color: #ffffff; }
.sc-btn-primary:hover { background: #1d4ed8; }

.sc-btn-secondary { background: #ffffff; color: #475569; border: 1px solid #cbd5e1; }
.sc-btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; color: #0f172a; }

.sc-btn-success { background: #16a34a; color: #ffffff; }
.sc-btn-success:hover { background: #15803d; }

.sc-btn-danger { background: #dc2626; color: #ffffff; }
.sc-btn-danger:hover { background: #b91c1c; }

.sc-btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; border-radius: 6px; font-weight: 600; }

.sc-btn-muted {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.sc-btn-muted:hover { background: #e2e8f0; color: #0f172a; }

.sc-btn-warn-outline {
  background: #fff;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.sc-btn-warn-outline:hover { background: #fff7ed; }

.sc-review-foot {
  position: sticky;
  bottom: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.sc-review-foot-title {
  font-weight: 650;
  font-size: 0.95rem;
  color: #0f172a;
}
.sc-review-foot-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.15rem;
  max-width: 36rem;
  line-height: 1.35;
}
.sc-review-foot-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.sc-review-foot .sc-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.sc-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 0.65rem;
  text-align: center;
}

.sc-stat-val { font-size: 1.45rem; font-weight: 800; line-height: 1.1; margin-bottom: 0.15rem; }
.sc-stat-label { font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }

.sc-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 1.25rem;
  margin: -1.5rem -1.5rem 1.5rem -1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.sc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.sc-breadcrumb-link {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.sc-breadcrumb-link:hover { text-decoration: underline; }

.sc-progress-track {
  background: #e2e8f0;
  border-radius: 9999px;
  height: 8px;
  overflow: hidden;
}

.sc-progress-fill {
  background: linear-gradient(90deg, #2563eb, #16a34a);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* SKU Autocomplete Search Palette (Google Sheets / Command Palette Style) */
.sc-autocomplete-container { position: relative; }
.sc-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 0.35rem;
}

.sc-autocomplete-item {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
}

.sc-autocomplete-item:hover, .sc-autocomplete-item.active {
  background: #eff6ff;
}

.sc-autocomplete-sku { font-family: monospace; font-weight: 800; color: #1e3a8a; }
.sc-autocomplete-name { font-weight: 600; color: #0f172a; margin-left: 0.5rem; }

/* Shimmer Skeleton Loading Placeholder */
@keyframes scShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.sc-skeleton-box {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: scShimmer 1.5s infinite;
  border-radius: 8px;
}

/* User Management Modal & Permissions Styles */
.user-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: userModalFadeIn 0.2s ease-out;
}

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

@keyframes userModalPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cd-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.cd-user-card {
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  animation: cdCardIn 0.4s ease-out both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.cd-user-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}
.cd-user-card strong {
  display: block;
  font-size: 0.95rem;
  color: #0f172a;
}
.cd-user-card .cd-user-email {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.2rem 0 0.55rem;
}
.cd-user-card .cd-user-shops {
  display: block;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.35;
}
#btnCdUpdatePewang.btn-primary {
  width: auto;
  white-space: nowrap;
}
.cd-link-create {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.98) 42%),
    #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
.cd-link-create-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.15rem;
}
.cd-links-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 1rem;
  align-items: start;
}
.cd-link-side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}
.cd-link-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.cd-link-list-head strong {
  font-size: 0.95rem;
  color: #0f172a;
}
.cd-link-branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.45rem;
  max-height: 240px;
  overflow: auto;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}
.cd-link-branch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: #334155;
  cursor: pointer;
}
.cd-link-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.cd-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 0.15rem;
}
.cd-link-card {
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.88);
  animation: cdCardIn 0.35s ease-out both;
}
.cd-link-card.is-closed {
  opacity: 0.72;
}
.cd-link-card.is-audit-on {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.cd-link-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.cd-link-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}
.cd-link-activity {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
}
.cd-link-status {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.cd-link-card.is-closed .cd-link-status {
  color: #64748b;
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.cd-link-url {
  margin: 0.65rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: #1d4ed8;
  word-break: break-all;
  background: #eff6ff;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
.cd-link-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cd-link-copy.is-copied {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #fff !important;
}
.cd-audit-panel {
  margin-top: 1.15rem;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 38%);
  padding: 0.95rem 1rem 1.05rem;
}
.cd-audit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.cd-audit-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cd-audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(42vh, 420px);
  overflow: auto;
}
.cd-audit-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1.4fr) auto;
  gap: 0.55rem 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #e8eef7;
  background: rgba(255, 255, 255, 0.92);
}
.cd-audit-who {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.cd-audit-who strong {
  color: #0f172a;
  font-size: 0.9rem;
}
.cd-audit-who span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
}
.cd-audit-what {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.cd-audit-detail {
  font-size: 0.86rem;
  font-weight: 650;
  color: #1e293b;
}
.cd-audit-meta {
  font-size: 0.75rem;
  color: #64748b;
}
.cd-audit-when {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  text-align: right;
}
.cd-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 1.1rem;
  padding: 0.28rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  width: fit-content;
  max-width: 100%;
}
.cd-page-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 750;
  font-size: 0.9rem;
  padding: 0.62rem 1.05rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.cd-page-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.65);
}
.cd-page-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}
.cd-seg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.cd-seg-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-weight: 750;
  font-size: 0.84rem;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.cd-seg-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  color: #0f172a;
}
.cd-seg-btn.is-on {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}
.cd-seg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cd-ni-table-shell .cd-ni-table .cd-new-price,
.cd-ni-table-shell .cd-ni-table .cd-new-model {
  width: 78px;
  max-width: 100%;
  font-weight: 800;
  text-align: center;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.25rem;
  font-size: 0.85rem;
}
.cd-ni-table-shell .cd-ni-table .cd-new-model {
  width: 96px;
  text-align: left;
  padding-left: 0.45rem;
}
.cd-ni-table-shell .cd-ni-table .cd-new-price.is-required {
  border-color: #f87171;
  background: #fff7f7;
}
.cd-ni-table .cd-ni-name {
  display: block;
  font-size: 0.92rem;
  color: #0f172a;
}
.cd-ni-table .cd-ni-sub {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 650;
}
.cd-ni-table .cd-ni-qty {
  font-weight: 900;
  color: #1d4ed8;
}
.cd-ni-table .cd-ni-done {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #15803d;
}
.cd-ni-table .cd-ni-muted {
  color: #94a3b8;
  font-weight: 700;
}
.cd-ni-table .cd-ni-error {
  margin-top: 0.25rem;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 700;
}
.cd-ni-issue-banner {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.cd-ni-issue-banner strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.cd-ni-issue-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}
.cd-ni-issue-list code {
  font-weight: 800;
  color: #7f1d1d;
}
.cd-ni-table td {
  vertical-align: middle;
}
.cd-ni-table td[data-label="Status"] {
  min-width: 7.5rem;
  width: 7.5rem;
  white-space: nowrap;
}
.cd-ni-table .cd-rev-pill {
  white-space: nowrap;
}
.cd-ni-branch-head td {
  padding: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
}
.cd-ni-branch-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border: 1px solid #bfdbfe;
}
.cd-ni-branch-banner strong {
  font-size: 0.95rem;
  font-weight: 850;
  color: #0f172a;
}
.cd-ni-branch-banner span {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}
.cd-rev-branch-banner {
  width: 100%;
}
.cd-rev-branch-banner-text {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}
.cd-rev-table-actions {
  white-space: nowrap;
}
.cd-rev-table-actions .btn {
  margin: 0.1rem 0.15rem 0.1rem 0;
}
.cd-ni-table tbody tr.cd-ni-row:first-of-type td,
.cd-ni-table tbody tr.cd-ni-branch-head + tr.cd-rev-row td,
.cd-ni-table tbody tr.cd-ni-branch-head + tr.cd-ni-row td {
  border-top: 0;
}
@media (max-width: 960px) {
  .cd-ni-table-shell .cd-ni-table .cd-new-price,
  .cd-ni-table-shell .cd-ni-table .cd-new-model {
    width: 100%;
  }
}
.cd-page-body.is-check-tab .prod-cd-phone-wrap {
  margin-top: 0.5rem;
}
@media (max-width: 960px) {
  .cd-links-layout {
    grid-template-columns: 1fr;
  }
  .cd-audit-row {
    grid-template-columns: 1fr;
  }
  .cd-audit-when {
    text-align: left;
  }
}

.user-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 580px;
  border-radius: 14px;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: userModalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-modal-header {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.user-modal-header .sub {
  margin: 0.2rem 0 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.user-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s ease;
}

.user-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.user-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 75vh;
  overflow-y: auto;
}

.user-modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.perm-section {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
}

.perm-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.perm-section-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 0.85rem 0;
}

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

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

/* Small-screen: white header + bottom dock tabs */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    padding-top: 0;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }
  .aside {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    background: #fff;
    color: #0f172a;
    column-gap: 0.65rem;
    row-gap: 0;
    padding: 0.55rem 0.85rem;
    box-shadow: 0 1px 0 #e2e8f0;
  }
  .aside-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
  }
  .aside-brand {
    border: none;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    gap: 0.5rem;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #334155;
    padding: 0;
    flex-shrink: 0;
    border-radius: 8px;
  }
  .aside-logo {
    width: 34px;
    height: 34px;
  }
  .aside-brand-sub { display: none; }
  .aside-brand-title { font-size: 0.95rem; color: #0f172a; font-weight: 800; }
  .aside-user {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    flex: 0 0 auto;
    min-width: 0;
  }
  .aside-user .name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    max-width: 7.5rem;
  }
  .aside-user .role { display: none; }
  .aside-nav,
  .aside-foot {
    display: none !important;
  }

  .mobile-dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.35rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: flex-end;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.04);
  }
  .dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.12rem;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    min-width: 0;
    padding: 0.2rem 0.15rem;
  }
  .dock-item.active { color: #2563eb; }
  .dock-svg { display: block; }
  .dock-item-new {
    position: relative;
    top: -0.35rem;
  }
  .dock-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
    margin-bottom: 0.05rem;
  }
  .dock-item-new.active .dock-fab { background: #1d4ed8; }
  .dock-item-new span:last-child { color: #64748b; }
  .dock-item-new.active span:last-child { color: #2563eb; }
  .dock-fab .dock-svg { width: 24px; height: 24px; stroke-width: 2.2; }

  .mobile-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.4);
    padding: 0;
  }
  .mobile-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 0.75rem 0.75rem calc(5.2rem + env(safe-area-inset-bottom, 0px));
    max-height: 72vh;
    overflow-y: auto;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
  }
  .mobile-sheet-head {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.35rem 0.55rem 0.65rem;
  }
  .mobile-sheet-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
  }
  .mobile-sheet-btn.active {
    background: #eff6ff;
    color: #1d4ed8;
  }
  .mobile-sheet-ver {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    padding: 0.5rem 0 0.25rem;
  }

  .cleanup-embed {
    height: calc(100vh - 7.4rem);
    min-height: 360px;
    margin-top: 0;
  }
}

/* Small-screen polish for Stock Count + admin screens */
@media (max-width: 820px) {
  .main {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
  .topbar {
    gap: 0.6rem;
    padding: 0.9rem 0.95rem;
  }
  .topbar .greeting h1 {
    font-size: 1.2rem;
    line-height: 1.2;
  }
  .panel {
    border-radius: 10px;
    padding: 0.85rem;
  }
  .table-wrap {
    overflow-x: auto;
  }
  .table-wrap table {
    min-width: 640px;
  }

  .sc-page-container {
    padding: 0;
  }
  .sc-card:not(.sc-new-items-table-card) {
    border-radius: 12px;
    padding: 0.9rem !important;
  }
  .sc-page-container .form-control {
    font-size: 16px; /* prevents mobile zoom jump */
  }
  .sc-page-container .btn,
  .sc-page-container .sc-btn {
    min-height: 40px;
  }

  .sc-page-container [style*="grid-template-columns:repeat(auto-fill, minmax(320px, 380px))"] {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  .sc-page-container [style*="grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))"],
  .sc-page-container [style*="grid-template-columns:repeat(auto-fit, minmax(260px, 1fr))"],
  .sc-page-container [style*="grid-template-columns:repeat(auto-fit, minmax(150px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 560px) {
  .sc-page-container [style*="display:flex; gap:0.4rem; border-top:1px solid #f1f5f9"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .sc-page-container [style*="display:flex; gap:0.4rem; border-top:1px solid #f1f5f9"] > * {
    width: 100% !important;
  }
  .sc-page-container [style*="justify-content:space-between; align-items:center; margin-bottom:1.25rem; flex-wrap:wrap"] {
    align-items: stretch !important;
  }
}

.sc-session-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.sc-session-actions.compact {
  flex-wrap: wrap;
}

.sc-actions-menu {
  position: relative;
}

.sc-actions-menu > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
  padding: 0.4rem 0.65rem;
  color: #334155;
  user-select: none;
}

.sc-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.sc-actions-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 165px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
  padding: 0.45rem;
}

.sc-actions-menu-list .sc-btn {
  justify-content: flex-start;
}

@media (max-width: 1320px) {
  .sc-new-items-table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }
  .sc-new-items-table {
    width: 100%;
    min-width: 760px;
  }
  .sc-col-optional {
    display: none;
  }
}

@media (max-width: 1080px) {
  .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .sc-new-items-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .sc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .sc-session-grid {
    grid-template-columns: 1fr !important;
  }
  .sc-filter-toolbar {
    align-items: stretch !important;
  }
  .sc-filter-toolbar #scSearchInput,
  .sc-filter-toolbar .sc-filter-select {
    width: 100%;
    min-width: 0 !important;
  }
  .sc-page-title {
    font-size: 1.55rem !important;
  }
  .sc-new-items-head {
    margin-bottom: 1rem !important;
  }
  .sc-new-items-head h1 {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 640px) {
  .sc-summary-grid {
    grid-template-columns: 1fr !important;
  }
  .sc-new-items-stats {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 440px) {
  .sc-summary-grid {
    display: flex !important;
    overflow-x: auto;
    gap: 0.7rem !important;
    padding-bottom: 0.2rem;
    scroll-snap-type: x proximity;
  }
  .sc-summary-grid > .sc-card {
    min-width: 230px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

.perm-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.perm-card:hover {
  border-color: #2563eb;
  background: #f0f6ff;
}

.perm-card input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #2563eb;
  cursor: pointer;
}

.perm-card-info strong {
  display: block;
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.25;
}

.perm-card-info span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.3;
}

/* Modern Requisition Builder UI Redesign (Lovable Design System) */
.req-modern-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.req-modern-topbar h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.2rem 0;
  letter-spacing: -0.02em;
}

.req-modern-topbar .sub {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.drafts-dropdown-wrap {
  position: relative;
}

.drafts-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.drafts-dropdown-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.drafts-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.4rem;
  width: 280px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.draft-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease;
}

.draft-menu-item:hover, .draft-menu-item.active {
  background: #f1f5f9;
}

.draft-menu-item strong {
  display: block;
  font-size: 0.85rem;
  color: #0f172a;
}

.draft-menu-item span {
  font-size: 0.75rem;
  color: #64748b;
}

/* Stepper Navigation Timeline */
.req-stepper-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  width: 100%;
  box-sizing: border-box;
}

.req-stepper-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.req-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: all 0.15s ease;
}

.req-step-item:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}

.req-step-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.req-step-item.completed {
  color: #047857;
}

.req-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
}

.req-step-item.active .req-step-num {
  background: #2563eb;
  color: #ffffff;
}

.req-step-item.completed .req-step-num {
  background: #10b981;
  color: #ffffff;
}

.req-step-divider {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 0.5rem;
}

.req-step-divider.active {
  background: #3b82f6;
}

/* Redesigned Search & Add Toolbar */
.req-toolbar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.req-toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
}

.req-toolbar-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 1rem 0;
}

.req-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.req-search-box-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.req-search-box-wrap input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.4rem;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.req-search-box-wrap input:focus {
  background: #ffffff;
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.req-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.req-qty-box {
  width: 72px;
}

.req-qty-box input {
  width: 100%;
  text-align: center;
  padding: 0.65rem 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.req-qty-box input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Selected Products Table Card */
.req-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  margin: 0.75rem 0 0;
  width: 100%;
}

.req-table-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.req-table-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.req-table-card-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.req-list-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  flex-wrap: wrap;
}
.req-list-filter-cat-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.req-list-filter-cat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.req-list-filter-cat {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.84rem;
  color: #0f172a;
  background: #f8fafc;
  min-width: 11rem;
  max-width: 100%;
}
.req-list-filter-cat:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.req-list-search-wrap {
  flex: 1;
  min-width: 12rem;
}
.req-list-filter-bar .search-wrap input {
  font-size: 0.84rem;
  padding: 0.45rem 0.65rem 0.45rem 2.1rem;
}
.req-list-filter-icon {
  color: #64748b;
  display: inline-flex;
  flex-shrink: 0;
}
.req-list-filter-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
  color: #0f172a;
  background: #f8fafc;
}
.req-list-filter-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.req-list-filter-bar .btn,
.req-list-filter-bar .req-export-filtered-btn {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.req-list-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.req-list-bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.req-list-bulk-select {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.req-list-bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}
.req-list-bulk-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.req-list-bulk-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}
.req-list-bulk-bar .btn,
.req-list-bulk-bar .btn-primary {
  width: auto;
  flex: 0 0 auto;
  min-height: auto;
  white-space: nowrap;
}
.req-list-bulk-cat {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  color: #0f172a;
  background: #fff;
  min-width: 9rem;
  max-width: 12rem;
}
.req-list-bulk-cat:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.req-table th.col-select,
.req-table td.col-select {
  width: 2.4rem;
  text-align: center;
  padding-left: 0.55rem;
  padding-right: 0.35rem;
}
.req-table td.col-select input,
.req-list-bulk-check input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.req-table tr.req-line.is-selected {
  background: #eff6ff;
}
.req-table tr.req-line.is-selected:hover {
  background: #dbeafe;
}

.req-list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}
.req-list-pager-info {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}
.req-list-pager-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.req-list-pager-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.req-list-page-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.req-list-page-size-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.req-list-page-size {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: #0f172a;
  background: #fff;
  min-width: 4.5rem;
}
.req-list-pager-page {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  min-width: 7rem;
  text-align: center;
}

.line-field-edit {
  width: 100%;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.line-field-edit:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.line-sku-edit {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.line-prod-edit {
  font-weight: 600;
}
.line-model-edit {
  color: #475569;
}

.req-sku-pill {
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.req-table-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.cd-monitor-page .cd-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.cd-monitor-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.cd-monitor-card.is-open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.cd-monitor-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.cd-monitor-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0;
}
.cd-monitor-stat {
  font-size: 0.78rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.cd-monitor-stat.ok {
  background: #dcfce7;
  color: #166534;
}
.cd-monitor-stat.bad {
  background: #fee2e2;
  color: #991b1b;
}
.cd-monitor-stat.warn {
  background: #fef3c7;
  color: #92400e;
}
.cd-monitor-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cd-monitor-detail {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.cd-monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}
.cd-monitor-shop-pick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 220px;
}
.cd-monitor-shop-pick select {
  min-width: 260px;
}
.cd-monitor-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}


/* Pewang Monitor */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.pm-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.pm-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}
.pm-metric {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}
.pm-metric-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}
.pm-line {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  word-break: break-word;
}
.pm-line.pm-ok { color: #166534; }
.pm-line.pm-bad { color: #b91c1c; }
.pm-activity {
  min-height: 2.4rem;
  white-space: pre-wrap;
}
#pmFlight {
  white-space: pre-wrap;
}
.pm-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
}
.pm-ok { background: #dcfce7; color: #166534; }
.pm-warn { background: #fef3c7; color: #92400e; }
.pm-bad { background: #fee2e2; color: #991b1b; }
.pm-muted { background: #f1f5f9; color: #475569; }
.pm-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
  padding: 0.35rem 0;
  overflow: hidden;
}
.pm-spark-empty {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0;
}
.pm-bar {
  flex: 1 1 0;
  min-width: 4px;
  max-width: 14px;
  border-radius: 3px 3px 0 0;
  background: #94a3b8;
}
.pm-bar-ok { background: #22c55e; }
.pm-bar-warn { background: #f59e0b; }
.pm-bar-bad { background: #ef4444; }
.pm-log {
  max-height: 420px;
  overflow: auto;
  margin-top: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.pm-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.88rem;
}
.pm-row:last-child { border-bottom: none; }
.pm-time {
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.pm-msg { color: #0f172a; font-weight: 600; }
.pm-kind-stress .pm-msg,
.pm-kind-err .pm-msg { color: #b91c1c; }
.pm-kind-protect .pm-msg { color: #b45309; }
.pm-kind-ok .pm-msg { color: #166534; }
.pm-kind-call .pm-msg { color: #1d4ed8; }
.pm-empty {
  padding: 1rem;
  color: #64748b;
  font-weight: 600;
}
@media (max-width: 820px) {
  .pm-row { grid-template-columns: 72px 1fr; font-size: 0.82rem; }
}

.pm-table-wrap {
  overflow: auto;
  max-height: min(58vh, 560px);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.pm-table-hint {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  font-weight: 550;
  color: #64748b;
  line-height: 1.45;
}
.pm-table-hint .pm-cause {
  vertical-align: middle;
  margin: 0 0.15rem;
}
.pm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.9rem;
  min-width: 900px;
}
.pm-col-status { width: 110px; }
.pm-col-when { width: 168px; }
.pm-col-who { width: 118px; }
.pm-col-speed { width: 118px; }
.pm-col-checks { width: 72px; }
.pm-col-explain { width: auto; }
.pm-table th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
.pm-table th:first-child { border-radius: 0; }
.pm-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  color: #0f172a;
}
.pm-table tbody tr:last-child td { border-bottom: none; }
.pm-table tbody tr:hover td { filter: brightness(0.985); }
.pm-tl-bad { background: #fff1f2; }
.pm-tl-ok { background: #f0fdf4; }
.pm-tl-warn { background: #fffbeb; }
.pm-tl-live td:first-child {
  box-shadow: inset 3px 0 0 #16a34a;
}
.pm-td-status {
  white-space: nowrap;
}
.pm-td-status .pm-pill {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  letter-spacing: 0.01em;
}
.pm-now-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pm-td-when {
  font-variant-numeric: tabular-nums;
}
.pm-tl-from {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.pm-tl-to {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-top: 0.2rem;
  line-height: 1.3;
}
.pm-tl-arrow {
  color: #94a3b8;
  font-weight: 700;
}
.pm-tl-dur {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}
.pm-td-who {
  white-space: nowrap;
}
.pm-td-speed {
  font-variant-numeric: tabular-nums;
}
.pm-speed-avg {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.pm-speed-avg strong {
  font-size: 1.05rem;
  font-weight: 800;
}
.pm-speed-avg span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}
.pm-speed-peak {
  margin-top: 0.2rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
}
.pm-td-checks {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pm-td-checks strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.pm-td-explain {
  min-width: 0;
}
.pm-tl-explain {
  font-size: 0.84rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.45;
}
.pm-cause {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pm-cause-pewang { background: #fee2e2; color: #991b1b; }
.pm-cause-delju { background: #dbeafe; color: #1d4ed8; }
.pm-cause-mixed { background: #ffedd5; color: #9a3412; }
.pm-cause-healthy { background: #dcfce7; color: #166534; }
.pm-cause-unknown { background: #f1f5f9; color: #475569; }
@media (max-width: 900px) {
  .pm-table { min-width: 780px; font-size: 0.84rem; }
  .pm-col-status { width: 96px; }
  .pm-col-when { width: 150px; }
  .pm-col-who { width: 104px; }
  .pm-col-speed { width: 104px; }
  .pm-col-checks { width: 64px; }
}

