:root {
  --color-brand-navy: #1a365d;
  --color-brand-primary: #2b6cb0;
  --color-brand-primary-hover: #3182ce;
  --color-brand-light: #63b3ed;
  --color-brand-pale: #ebf8ff;

  --color-page: #f0f2f5;
  --color-surface: #ffffff;
  --color-surface-subtle: #f7fafc;
  --color-surface-alternate: #fbfdff;
  --color-surface-selected: #eef6ff;

  --color-border-light: #edf2f7;
  --color-border: #e2e8f0;
  --color-border-strong: #d9e2ec;

  --color-text-strongest: #0f172a;
  --color-text: #2d3748;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-text-subtle: #a0aec0;
  --color-text-inverse: #ffffff;

  --color-success: #38a169;
  --color-success-strong: #276749;
  --color-success-bg: #f0fff4;
  --color-success-border: #9ae6b4;

  --color-warning: #dd6b20;
  --color-warning-strong: #c05621;
  --color-warning-bg: #fffaf0;
  --color-warning-border: #fbd38d;

  --color-danger: #e53e3e;
  --color-danger-strong: #c53030;
  --color-danger-light: #fc8181;
  --color-danger-bg: #fff5f5;
  --color-danger-border: #fed7d7;

  --color-info: #2b6cb0;
  --color-info-strong: #2c5282;
  --color-info-bg: #ebf8ff;
  --color-info-border: #bee3f8;

  --color-purple: #805ad5;
  --color-purple-strong: #553c9a;
  --color-purple-bg: #e9d8fd;
  --color-purple-border: #d6bcfa;

  --color-teal: #0f766e;
  --color-overlay: rgba(15, 23, 42, 0.45);
  --color-focus-ring: rgba(43, 108, 176, 0.10);
}
/*


 */

/* Hide default Turbo top progress bar — we use a full-screen page loader instead */
.turbo-progress-bar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.page-loader[hidden] {
  display: none !important;
}

.page-loader__card {
  min-width: 180px;
  padding: 28px 32px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  text-align: center;
}

.page-loader__spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: var(--color-brand-primary, #2563eb);
  animation: page-loader-spin 0.75s linear infinite;
}

.page-loader__label {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}

@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}

html.is-page-loading,
html.is-page-loading body {
  cursor: progress;
}

/* Theme aliases used by existing app styles.
   Source-of-truth is `theme.css` (ERP blueprint tokens). */
:root {
  /* App shell sizing */
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 68px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Common aliases */
  --bg: var(--color-page);
  --card: var(--color-surface);
  --text: var(--color-text);
  --text-secondary: var(--color-text-secondary);
  --muted: var(--color-text-muted);
  --border: var(--color-border);
  --table-head-bg: #edf2f7;
  --table-row-alt: #f7fafc;

  /* Brand */
  --accent: var(--color-brand-primary);
  --accent-dark: var(--color-brand-primary-hover);
  --accent-light: var(--color-brand-pale);
  --brand-blue: var(--color-brand-primary);
  --brand-blue-dark: var(--color-brand-primary-hover);

  /* Sidebar */
  --sidebar-bg: var(--color-brand-navy);
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(43, 108, 176, 0.30);
  --sidebar-active-border: var(--color-brand-light);
  --sidebar-text: var(--color-text-inverse);
  --sidebar-text-muted: var(--color-text-subtle);

  /* Semantic */
  --danger: var(--color-danger);
  --danger-soft: var(--color-danger-bg);
  --success: var(--color-success);
  --success-bright: var(--color-success);
  --warning: var(--color-warning);
  --purple: var(--color-purple);
  --orange: var(--color-warning);
  --pink: var(--color-danger-light);
  --teal: var(--color-teal);

  /* Logout */
  --logout: rgba(229, 62, 62, 0.15);
  --logout-hover: rgba(229, 62, 62, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body.sidebar-open {
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  transition: width 0.22s ease;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 56px;
  flex-shrink: 0;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-toggle:hover {
  background: rgba(255,255,255,0.12);
}

.sidebar-toggle-icon,
.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}

.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.sidebar-toggle-icon::before { top: -5px; }
.sidebar-toggle-icon::after { top: 5px; }

.brand-name {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.22s ease;
}

.app-shell.sidebar-collapsed .brand-name,
.app-shell.sidebar-collapsed .nav-section-title,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-user-label,
.app-shell.sidebar-collapsed .sidebar-logout-btn {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.app-shell.sidebar-collapsed .sidebar-user-avatar {
  margin-bottom: 6px;
}

.app-shell.sidebar-collapsed .brand {
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
}

.app-shell.sidebar-collapsed .brand-mark {
  width: 32px;
  height: 32px;
  font-size: 0.82rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: transparent transparent; /* hidden by default */
}

/* Sidebar scrollbar (WebKit) — blend into theme */
.sidebar-nav::-webkit-scrollbar {
  width: 10px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: transparent; /* hidden until hover */
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.sidebar:hover .sidebar-nav {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent; /* Firefox */
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.32);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.nav-section {
  padding: 10px 8px 2px;
}

.nav-section-title {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a6fa5; /* ERP section label */
  padding: 0 8px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 2px;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.app-shell.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 8px;
  gap: 0;
  border-left: none;
}

.app-shell.sidebar-collapsed .nav-link.active {
  border-left: none;
}

.app-shell.sidebar-collapsed .nav-section {
  padding: 8px 6px 4px;
}

.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active {
  background: var(--sidebar-active);
  color: var(--color-brand-light);
  border-left-color: var(--sidebar-active-border);
  box-shadow: none;
}

.nav-icon {
  width: 18px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
  opacity: 0.95;
}

.nav-icon-inner {
  display: inline-grid;
  place-items: center;
}

.nav-icon-inner svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Sidebar icon colors (match ERP feel) */
.nav-icon-inner--dashboard { color: #f6ad55; } /* orange/yellow */
.nav-icon-inner--ceo-dashboard { color: #63b3ed; }
.nav-icon-inner--approvals { color: var(--color-danger); }
.nav-icon-inner--projects { color: var(--color-success); }
.nav-icon-inner--modules { color: var(--color-info); }
.nav-icon-inner--bom { color: var(--color-warning); }
.nav-icon-inner--inventory { color: var(--color-teal); }
.nav-icon-inner--inventory-manage { color: #48bb78; }
.nav-icon-inner--inventory-out { color: #fc8181; }
.nav-icon-inner--inventory-return { color: #f6ad55; }
.nav-icon-inner--inventory-requests { color: var(--color-purple); }
.nav-icon-inner--inventory-log { color: #90cdf4; }
.nav-icon-inner--inventory-transfer { color: #9f7aea; }
.nav-icon-inner--rack { color: #d69e2e; }
.nav-icon-inner--item-rack { color: #ecc94b; }
.nav-icon-inner--vendors { color: var(--color-warning); }
.nav-icon-inner--items { color: var(--color-info); }
.nav-icon-inner--rfq { color: var(--color-purple); }
.nav-icon-inner--quotations { color: var(--color-purple); }
.nav-icon-inner--purchase-orders { color: var(--color-warning); }
.nav-icon-inner--grn { color: var(--color-warning); }
.nav-icon-inner--customers { color: var(--color-info); }
.nav-icon-inner--sales-orders { color: var(--color-warning); }
.nav-icon-inner--payments { color: var(--color-success); }
.nav-icon-inner--users { color: var(--color-info); }
.nav-icon-inner--company { color: #cbd5e1; }
.nav-icon-inner--address { color: var(--color-danger-light); }

.nav-label {
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.22s ease;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-user-block {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.sidebar-user-label {
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8125rem;
}

.user-chip {
  display: none;
}

.user-avatar {
  display: none;
}

.user-meta {
  display: none;
}

.logout-form,
.logout-form-icon {
  margin: 0;
  padding: 0;
}

.btn-logout,
.sidebar-logout-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--logout);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-logout:hover,
.sidebar-logout-btn:hover {
  background: var(--logout-hover);
}

.btn-logout-icon {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--logout);
  color: #fff;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
}

.btn-logout-icon:hover {
  background: var(--logout-hover);
}

.app-shell.sidebar-collapsed .sidebar-user-block {
  padding: 8px 6px;
}

.app-shell.sidebar-collapsed .btn-logout-icon {
  display: grid;
  place-items: center;
  margin: 0 auto;
}

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

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.topbar-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.topbar-back-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.topbar-back-btn:active {
  background: #f1f5f9;
}

.topbar-back-icon {
  display: block;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-date {
  color: var(--muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #bfdbfe;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.company-badge:hover {
  background: #dbeafe;
  color: var(--accent-dark);
}

.text-muted {
  color: var(--muted);
  font-size: 0.8125rem;
}

.company-form {
  max-width: 900px;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  cursor: pointer;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
}

.content {
  padding: 14px 18px 24px;
}

.flash {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
}
.flash.notice { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.alert { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

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

.toolbar h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }

/* Merge toolbar + panel into one ERP card on list pages */
.content > .toolbar:has(+ .panel) {
  background: white;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
  margin-bottom: 0;
  padding: 12px 16px;
}

.content > .toolbar:has(+ .panel) + .panel {
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: none;
  margin-bottom: 14px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  background: white;
  color: var(--text);
  line-height: 1.2;
  min-height: 32px;
  user-select: none;
  box-shadow: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 60ms ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary:active { transform: translateY(0.5px); }

.btn-outline {
  border-color: var(--color-border);
  background: var(--color-border-light); /* secondary background */
  color: var(--color-text-secondary);
}
.btn-outline:hover { background: var(--color-border); border-color: var(--color-border); }
.btn-outline:active { transform: translateY(0.5px); }

.btn-danger {
  color: var(--color-danger);
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
}
.btn-danger:hover {
  background: rgba(229, 62, 62, 0.08);
  border-color: var(--color-danger-border);
}
.btn-danger:active { transform: translateY(0.5px); }

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8125rem;
  min-height: 28px;
}
.btn-success { background: var(--color-success-bg); color: var(--color-success-strong); border-color: var(--color-success-border); }
.btn-warning { background: var(--color-warning-bg); color: var(--color-warning-strong); border-color: var(--color-warning-border); }

.btn-success:hover { filter: brightness(0.95); }
.btn-warning:hover { filter: brightness(0.95); }

.btn:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

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

.kpi-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-top: none;
}
.kpi-card.green { border-left-color: var(--success-bright); }
.kpi-card.purple { border-left-color: var(--purple); }
.kpi-card.orange { border-left-color: var(--orange); }
.kpi-card.red { border-left-color: var(--danger); }
.kpi-card.teal { border-left-color: var(--teal); }
.kpi-card.pink { border-left-color: var(--pink); }
.kpi-card.blue { border-left-color: #1d4ed8; }
.kpi-label { color: var(--muted); font-size: 0.75rem; margin-bottom: 4px; }
.kpi-value { font-size: 1.25rem; font-weight: 700; }
.kpi-value--currency { font-size: 1.1rem; }
.kpi-sub { color: var(--muted); font-size: 0.75rem; margin-top: 2px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.erp-page-card__body--cards {
  padding: 16px;
}

.cards-grid--projects {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.project-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.project-card--open,
.project-card--active {
  border-top: 3px solid #2563eb;
}

.project-card--completed {
  border-top: 3px solid #16a34a;
}

.project-card--on_hold {
  border-top: 3px solid #d97706;
}

.project-card--cancelled {
  border-top: 3px solid #e11d48;
}

.project-card__header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid #f1f5f9;
}

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

.project-card-head .badge {
  font-size: 0.625rem;
  padding: 3px 8px;
  letter-spacing: 0.05em;
}

.project-code {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.project-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0f172a;
  line-height: 1.35;
}

.project-title-link {
  color: inherit;
  text-decoration: none;
}

.project-title-link:hover {
  color: #1d4ed8;
}

.project-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.project-meta-icon {
  display: inline-flex;
  color: #64748b;
  flex-shrink: 0;
}

.project-meta__divider {
  color: #cbd5e1;
}

.project-meta__modules {
  color: #475569;
}

.project-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: #fafbfc;
}

.project-card .progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.project-card .progress-row__label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card .progress-row__value {
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.project-card .progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.project-card .progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 999px;
  min-width: 2px;
}

.project-financials {
  padding: 14px 18px 16px;
}

.project-financials__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-financial {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.project-financial__label {
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  line-height: 1.2;
}

.project-financial__value {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9375rem;
  line-height: 1.3;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.project-financial__value.is-danger { color: #e11d48; }
.project-financial__value.is-success { color: #15803d; }
.project-financial__value.is-accent { color: #1d4ed8; }
.project-financial__value.is-muted { color: #475569; font-weight: 600; font-size: 0.875rem; }

/* Legacy aliases kept for any other views still using old class names */
.project-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-stat__label { color: #64748b; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.project-stat__value { font-weight: 700; color: #0f172a; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.project-stat__value.is-danger { color: #e11d48; }
.project-stat__value.is-success { color: #15803d; }
.project-stat__value.is-accent { color: #1d4ed8; }

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 12px 18px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}

.project-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.project-card-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.project-card-btn--danger {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #be123c;
}

.project-card-btn--danger:hover {
  background: #fecdd3;
  color: #9f1239;
}

.project-card-actions .inline-form {
  display: inline;
  margin: 0;
}

.projects-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.projects-kpi-grid {
  margin-bottom: 0;
}

.projects-kpi-budget {
  color: #be123c !important;
  font-weight: 600;
}

.projects-summary-subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.projects-summary-cell {
  font-size: 0.75rem;
  color: #475569;
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
}

.projects-summary-table td {
  vertical-align: top;
}

.projects-cards-panel .empty {
  padding: 28px 12px;
  text-align: center;
  color: #94a3b8;
}

.table-subtext {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.module-table th {
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.module-table td {
  color: var(--color-text);
  vertical-align: middle;
}

.module-table .actions {
  white-space: nowrap;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-box {
  background: var(--table-row-alt);
  border-radius: 8px;
  padding: 10px;
}
.stat-box .value.danger { color: var(--danger); }

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

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

.panel h3,
.content h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

/* ERP list page card (User Management, etc.) */
.erp-page-card {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.erp-page-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-wrap: wrap;
}

.erp-page-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.erp-page-card__body {
  background: white;
}

.erp-page-card__body--form {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-top: 1px solid var(--color-border);
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Force real HTML table layout on all listing pages (never card-stack) */
table.data-table {
  display: table !important;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  table-layout: auto;
}

table.data-table thead { display: table-header-group !important; }
table.data-table tbody { display: table-row-group !important; }

table.data-table tr {
  display: table-row !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

table.data-table th,
table.data-table td {
  display: table-cell !important;
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--color-text);
  white-space: nowrap;
}

table.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #edf2f7 !important;
  font-weight: 700;
  border-bottom: 1px solid var(--color-border-strong);
}

/* Truncate only long free-text columns; codes stay fully visible */
table.data-table td.col-truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data-table td.col-code,
table.data-table th.col-code {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
}

table.data-table tbody tr {
  background: #ffffff;
  transition: background-color 100ms ease;
}

table.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

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

table.data-table tbody tr:last-child td {
  border-bottom: 1px solid var(--color-border);
}

table.data-table td strong {
  color: var(--color-text-strongest);
  font-weight: 700;
}

table.data-table td strong a,
table.data-table td a.table-link {
  color: var(--accent);
  font-weight: 700;
}

table.data-table td strong a:hover,
table.data-table td a.table-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

table.data-table .text-muted,
table.data-table .table-subtext {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data-table .num,
table.data-table td.num,
table.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data-table td.empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 28px 16px;
  height: auto;
  font-size: 0.9375rem;
  white-space: normal;
}

.erp-page-card__body.table-wrap,
.erp-page-card__body .table-wrap {
  background: white;
}

.erp-page-card__header {
  border-bottom: 1px solid var(--color-border);
  background: #ffffff;
}

table.erp-users-table td {
  vertical-align: middle;
  font-size: 0.9375rem;
  color: #111827;
}

table.erp-users-table .cell-user-id {
  font-weight: 700;
  color: #111827;
}

table.data-table .actions,
table.data-table th:last-child,
table.data-table td.actions {
  white-space: nowrap;
  vertical-align: middle;
  overflow: visible;
  max-width: none;
  width: 140px;
}

table.data-table .actions > a,
table.data-table .actions > button,
table.data-table .actions > form,
table.data-table .actions > .btn {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 8px;
}

table.data-table .actions > *:last-child {
  margin-right: 0;
}

table.data-table .actions .inline-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.btn-edit {
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
}

.btn-edit:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-deactivate {
  color: #be123c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.btn-deactivate:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.badge-active {
  background: var(--success-bright);
  color: #fff;
  border: none;
  font-size: 0.6875rem;
  padding: 4px 10px;
}

.badge-inactive {
  background: #e5e7eb;
  color: #6b7280;
  border: none;
  font-size: 0.6875rem;
  padding: 4px 10px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.3;
}

.pill-role {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pill-app {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.role-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.8125rem;
}

.checkbox-chip input {
  width: auto;
}

.rack-multi-picker {
  display: block;
  width: 100%;
}

.rack-multi-picker__field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: text;
}

.rack-multi-picker__field:focus-within {
  border-color: var(--color-brand-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--color-focus-ring, rgba(37, 99, 235, 0.15));
}

.rack-multi-picker__chips {
  display: contents;
}

.rack-multi-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.rack-multi-picker-selected:empty {
  display: none;
}

.rack-multi-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.8125rem;
  line-height: 1.2;
}

.rack-multi-picker-chip__remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.rack-multi-picker-chip__remove:hover {
  color: #dc2626;
}

.rack-multi-picker-input {
  flex: 1 1 160px;
  min-width: 160px;
  width: auto;
  border: 0;
  outline: none;
  padding: 4px 2px;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: none;
}

.rack-multi-picker .field-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.item-rack-edit-form {
  max-width: 720px;
}

.item-rack-edit-form .field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.item-form .rack-multi-picker__field input[type="text"] {
  width: auto;
  min-height: 0;
  border: 0;
  box-shadow: none;
  padding: 4px 2px;
  background: transparent;
}

.item-form .rack-multi-picker__field input[type="text"]:focus {
  border: 0;
  box-shadow: none;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
}
.badge-open { background: var(--color-page); color: var(--color-text-muted); border-color: var(--color-border); }
.badge-success { background: var(--color-success-bg); color: var(--color-success-strong); border-color: var(--color-success-border); }
.badge.inventory-request-returnable-yes {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.08);
}
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-strong); border-color: var(--color-warning-border); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-strong); border-color: var(--color-danger-border); }
.badge-purple { background: var(--color-purple-bg); color: var(--color-purple-strong); border-color: var(--color-purple-border); }
.badge-muted { background: var(--color-surface-subtle); color: var(--color-text-muted); border-color: var(--color-border); }

.pill-type-raw {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pill-type-finished {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.pill-type-service {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.pill-type-consumable {
  background: #fff7ed;
  color: #c05621;
  border: 1px solid #fed7aa;
}

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

body.modal-open {
  overflow: hidden;
}

.erp-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.erp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.erp-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.erp-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.erp-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strongest);
}

.erp-modal__close {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.erp-modal__close:hover {
  color: var(--color-text);
}

.erp-modal__form {
  display: flex;
  flex-direction: column;
}

.erp-modal__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.erp-modal__info {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--color-brand-pale);
  border: 1px solid #bee3f8;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.erp-modal__checkbox-field {
  margin-top: 4px;
}

.erp-modal__checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  text-transform: none !important;
  font-size: 0.875rem !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  color: var(--color-text-primary) !important;
  cursor: pointer;
  line-height: 1.4;
}

.erp-modal__checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.erp-modal__status {
  margin: 0;
}

.erp-modal__import-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.erp-modal__import-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: erp-modal-spin 0.7s linear infinite;
}

@keyframes erp-modal-spin {
  to { transform: rotate(360deg); }
}

.vendor-csv-modal__dialog {
  width: min(100%, 580px);
}

.vendor-csv-modal__header {
  align-items: flex-start;
}

.vendor-csv-modal__heading {
  min-width: 0;
}

.vendor-csv-modal__subtitle {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 400;
  line-height: 1.45;
}

.vendor-csv-modal__body {
  gap: 16px;
}

.vendor-csv-modal__tips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.vendor-csv-modal__tip {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #1e3a5f;
}

.vendor-csv-modal__tip-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.vendor-csv-modal__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vendor-csv-modal__label {
  display: block;
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
  font-weight: 700;
}

.vendor-csv-modal__dropzone {
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 12px;
  background: #f8fafc;
}

.vendor-csv-modal__file {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  color: #334155;
}

.vendor-csv-modal__file:focus {
  outline: none;
}

.vendor-csv-modal__dropzone:focus-within {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.vendor-csv-modal__dropzone-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.vendor-csv-modal__force {
  position: relative;
  margin: 0;
}

.vendor-csv-modal__force-input {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.vendor-csv-modal__force-label {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  margin: 0 !important;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  color: inherit !important;
  font-size: inherit !important;
}

.vendor-csv-modal__force-label:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.vendor-csv-modal__force-input:focus-visible + .vendor-csv-modal__force-label {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.vendor-csv-modal__force-input:checked + .vendor-csv-modal__force-label {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.vendor-csv-modal__force-box {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
  position: relative;
}

.vendor-csv-modal__force-input:checked + .vendor-csv-modal__force-label .vendor-csv-modal__force-box {
  border-color: #2563eb;
  background: #2563eb;
}

.vendor-csv-modal__force-input:checked + .vendor-csv-modal__force-label .vendor-csv-modal__force-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.vendor-csv-modal__force-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vendor-csv-modal__force-copy strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
}

.vendor-csv-modal__force-copy span {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.vendor-csv-modal__status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vendor-csv-modal__status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.vendor-csv-modal__status--progress {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.vendor-csv-modal__status--result {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  font-weight: 600;
}

.vendor-csv-modal__footer {
  flex-wrap: wrap;
}

.erp-modal__field label {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-brand-navy);
  font-weight: 600;
}

.erp-modal__file-input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  box-shadow: none;
}

.erp-modal__file-input:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.erp-modal__field textarea.approval-remark-textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  box-shadow: none;
  font-size: 0.875rem;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.erp-modal__field textarea.approval-remark-textarea:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.erp-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.erp-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Item form — matches RFQ soft-gray field theme */
.item-form .field label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #475569;
  font-weight: 700;
}

.item-form .required {
  color: var(--color-danger);
}

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

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

.item-form .field input[type="text"],
.item-form .field input[type="number"],
.item-form .field input[type="date"],
.item-form .field input[type="email"],
.item-form .field select,
.item-form .field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.item-form .field textarea {
  min-height: 84px;
  resize: vertical;
}

.item-form .field input::placeholder,
.item-form .field textarea::placeholder {
  color: #94a3b8;
}

.item-form .field input:focus,
.item-form .field select:focus,
.item-form .field textarea:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.item-form .field select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.item-form .form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.form-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 16px;
  max-width: 980px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.form-card .required {
  color: var(--color-danger);
}

/* ERP select / dropdown — global theme */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 7px 32px 7px 10px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  min-height: 36px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

select:hover {
  border-color: #cbd5e1;
  background-color: var(--color-surface-subtle);
}

select:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  background-color: var(--color-surface);
}

select:disabled {
  background-color: var(--color-surface-subtle);
  color: var(--color-text-subtle);
  cursor: not-allowed;
  opacity: 0.85;
}

.bom-form select:disabled,
.po-form select:disabled,
.grn-form select:disabled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23cbd5e1' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Toolbar / filter dropdowns */
.toolbar-actions .erp-filter-form {
  display: inline-flex;
  margin: 0;
}

.toolbar-actions select,
.erp-filter-form select {
  min-width: 190px;
  max-width: 280px;
  background-color: var(--color-surface);
  border-color: var(--color-border-strong);
  font-weight: 600;
  color: var(--color-text-secondary);
  min-height: 32px;
  padding: 6px 32px 6px 12px;
}

.toolbar-actions select:hover,
.erp-filter-form select:hover {
  border-color: var(--color-brand-primary);
  background-color: var(--color-brand-pale);
  color: var(--color-info-strong);
}

/* Compact selects inside tables */
table.data-table select,
.line-items table select {
  min-height: 30px;
  padding: 5px 28px 5px 8px;
  font-size: 0.75rem;
  background-position: right 8px center;
  background-size: 12px;
}

.field label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}

.field input[type="checkbox"],
.field input[type="radio"],
.field input[type="hidden"] {
  width: auto;
}

/* Shared soft field theme — all forms */
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="email"],
.field input[type="password"],
.field input[type="file"],
.field input[type="tel"],
.field select,
.field textarea {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #94a3b8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field select:disabled,
.field input:disabled,
.field input[readonly],
.field textarea:disabled,
.field textarea[readonly] {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: default;
}

.field select:disabled {
  cursor: not-allowed;
  color: #94a3b8;
}

.line-items {
  margin-top: 18px;
}
.line-items table input,
.line-items table select {
  width: 100%;
  min-width: 90px;
}
.line-items table input[type="text"],
.line-items table input[type="number"],
.line-items table input[type="file"],
.line-items table select {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
}

.line-items table input:focus,
.line-items table select:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.errors {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.quick-action {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}
.quick-action:hover { border-color: #93c5fd; }
.quick-action .icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1rem;
}
.quick-action .label { font-weight: 600; font-size: 0.75rem; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.summary-box {
  background: var(--table-row-alt);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.summary-row a {
  color: var(--accent);
  font-weight: 600;
}
.summary-row a:hover {
  color: var(--accent-dark);
}
.summary-row.strong {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9375rem;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0f172a, #1e293b 45%, #334155);
}
.auth-card {
  width: min(400px, 92vw);
  background: white;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.25rem; }
.auth-card p { color: var(--muted); margin-top: 0; font-size: 0.8125rem; }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

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

.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--color-text);
}
.detail-list .label {
  color: var(--color-text-secondary);
  font-weight: 600;
}
.detail-list li > span:last-child {
  color: var(--color-text-strongest);
  font-weight: 500;
  text-align: right;
}

/* ERP record detail pages */
.erp-record-page {
  max-width: 760px;
}

/* BOM details page — form-theme boxed layout */
.bom-show-page,
.po-show-page,
.item-show-page,
.project-show-page {
  width: 100%;
  max-width: none;
}

.project-show-kpi-grid {
  margin-bottom: 22px;
}

.project-show-page .bom-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-show-page .bom-box__section,
.project-show-page .bom-components-box {
  margin: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.project-show-section__head {
  padding: 14px 18px;
}

.project-show-section__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-show-section__title-wrap h3 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
}

.project-show-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.project-show-section__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-show-section--cash-outflow .project-show-section__count {
  background: #ffedd5;
  color: #c2410c;
}

.project-show-section--cash-outflow .bom-components-head {
  background: linear-gradient(180deg, #fff7ed 0%, #f1f5f9 100%);
}

.project-show-section--modules .project-show-section__count {
  background: #dbeafe;
  color: #1d4ed8;
}

.project-show-section--machines .project-show-section__count {
  background: #dcfce7;
  color: #15803d;
}

.project-show-section--misc .project-show-section__count {
  background: #f3e8ff;
  color: #7e22ce;
}

.project-show-overview {
  padding: 18px;
  gap: 16px 20px;
}

.project-show-table-wrap {
  overflow-x: auto;
}

.project-show-table-wrap--scroll {
  max-width: 100%;
}

.project-show-page table.data-table.project-show-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.project-show-page table.data-table.project-show-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.project-show-page table.data-table.project-show-table tbody td {
  padding: 13px 16px;
  font-size: 0.875rem;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 1.45;
}

.project-show-page table.data-table.project-show-table tbody tr:hover {
  background: #f8fafc;
}

.project-show-page table.data-table.project-show-table tbody tr:last-child td {
  border-bottom: none;
}

.project-show-page table.data-table.project-show-table tfoot td {
  background: #eef2ff;
  border-top: 2px solid #c7d2fe;
  border-bottom: none;
  padding: 13px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: 0.02em;
}

.project-show-table__entry {
  font-weight: 600;
  color: #1e3a5f;
  white-space: nowrap;
}

.project-show-table__date {
  white-space: nowrap;
  color: #475569;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
}

.project-show-table__amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.project-show-table__note {
  max-width: 220px;
  color: #64748b;
  font-size: 0.8125rem;
}

.project-show-empty {
  padding: 32px 20px;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.55;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-top: 1px solid #e2e8f0;
}

.project-show-page .bom-show-card__actions {
  row-gap: 8px;
}

.project-show-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.project-show-page .project-show-btn {
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.project-show-page .project-show-btn:hover {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.project-show-page .project-show-btn--edit {
  color: #374151;
  background: #fff;
  border-color: #cbd5e1;
}

.project-show-page .project-show-btn--edit:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.project-show-page .project-show-btn--machine {
  color: #fff;
  background: #059669;
  border-color: #047857;
}

.project-show-page .project-show-btn--machine:hover {
  background: #047857;
  border-color: #065f46;
}

.project-show-page .project-show-btn--module {
  color: #fff;
  background: #2563eb;
  border-color: #1d4ed8;
}

.project-show-page .project-show-btn--module:hover {
  background: #1d4ed8;
  border-color: #1e40af;
}

.project-show-page .project-show-btn--cash-out {
  color: #fff;
  background: #ea580c;
  border-color: #c2410c;
}

.project-show-page .project-show-btn--cash-out:hover {
  background: #c2410c;
  border-color: #9a3412;
}

.project-show-page .project-show-btn--misc {
  color: #fff;
  background: #7c3aed;
  border-color: #6d28d9;
}

.project-show-page .project-show-btn--misc:hover {
  background: #6d28d9;
  border-color: #5b21b6;
}

.project-show-page .project-show-btn--back {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.project-show-page .project-show-btn--back:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

@media (max-width: 768px) {
  .project-show-section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .project-show-section__actions {
    width: 100%;
  }

  .project-show-table__note {
    max-width: 140px;
  }
}

.payments-kpi-grid {
  margin-bottom: 18px;
}

.bom-show-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.bom-show-card__title {
  margin: 0;
}

.bom-show-card__subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bom-show-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bom-show-page .bom-show-grid .field {
  margin: 0;
}

.bom-show-page .bom-show-grid .field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.bom-show-field {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.bom-show-field--total {
  font-weight: 700;
  color: #1e3a5f;
}

.bom-show-page .bom-components-box {
  margin-top: 0;
}

.bom-components-hint {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.bom-show-page table.data-table.bom-show-items-table .col-select {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 10px 8px;
  overflow: visible;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
}

.bom-show-page table.data-table.bom-show-items-table .col-select input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  display: inline-block;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
  vertical-align: middle;
}

.bom-rfq-select-form .bom-components-head {
  align-items: flex-start;
}

.bom-rfq-select-form [data-bom-rfq-select-target="submitButton"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bom-show-page .bom-components-box {
  margin-top: 4px;
}

.bom-show-page .bom-components-table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bom-show-page table.data-table.bom-show-items-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed !important;
  background: #fff;
}

.bom-show-page table.data-table.bom-show-items-table th,
.bom-show-page table.data-table.bom-show-items-table td {
  overflow: hidden;
  max-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.bom-show-page table.data-table.bom-show-items-table .col-item { width: 17%; }
.bom-show-page table.data-table.bom-show-items-table .col-desc { width: 18%; }
.bom-show-page table.data-table.bom-show-items-table .col-qty { width: 7%; }
.bom-show-page table.data-table.bom-show-items-table .col-total-qty { width: 7%; }
.bom-show-page table.data-table.bom-show-items-table .col-uom { width: 6%; }
.bom-show-page table.data-table.bom-show-items-table .col-rate { width: 8%; }
.bom-show-page table.data-table.bom-show-items-table .col-amount { width: 8%; }
.bom-show-page table.data-table.bom-show-items-table .col-total-amount { width: 9%; }
.bom-show-page table.data-table.bom-show-items-table .col-attach { width: 9%; }
.bom-show-page table.data-table.bom-show-items-table .col-windows {
  width: 9%;
  min-width: 96px;
  white-space: normal;
}

.bom-show-page table.data-table.bom-show-items-table .col-windows .btn {
  white-space: nowrap;
}

.bom-schedule-view-modal {
  z-index: 1200;
}

.bom-schedule-view-modal__dialog {
  max-width: 1100px;
  width: min(1100px, calc(100vw - 2rem));
}

.bom-schedule-view-modal__body {
  padding: 1.25rem 1.5rem;
  max-height: min(75vh, 780px);
  overflow-y: auto;
}

.bom-schedule-table--readonly td.col-window {
  white-space: normal;
}

.bom-schedule-table--readonly tfoot td {
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
}

.bom-schedule-row-amount {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.bom-schedule-view-loading,
.bom-schedule-view-empty,
.bom-schedule-view-error {
  margin: 0;
  padding: 0.75rem 0;
  color: #64748b;
  font-size: 0.9375rem;
}

.bom-schedule-view-error {
  color: #b45309;
}

.bom-schedule-log-panel {
  margin-top: 1rem;
}

.bom-schedule-log-panel__title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #334155;
}

.bom-schedule-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.bom-schedule-log-list__item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.bom-schedule-log-list__item:last-child {
  border-bottom: none;
}

.bom-schedule-log-list__message {
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.45;
}

.bom-schedule-log-list__meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.badge-draft {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  vertical-align: middle;
}

.po-show-page .po-show-items-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

.po-show-page table.listing-grid.po-show-items-table {
  width: 100%;
  min-width: 960px;
  margin: 0;
  border-collapse: collapse;
}

.po-show-page table.listing-grid.po-show-items-table th,
.po-show-page table.listing-grid.po-show-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
  white-space: nowrap;
}

.po-show-page table.listing-grid.po-show-items-table th:last-child,
.po-show-page table.listing-grid.po-show-items-table td:last-child {
  border-right: none;
}

.po-show-page table.listing-grid.po-show-items-table thead th {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}

.po-show-page table.listing-grid.po-show-items-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.po-show-page table.listing-grid.po-show-items-table tbody tr:hover {
  background: #eff6ff;
}

.po-show-page table.listing-grid.po-show-items-table tbody tr:last-child td {
  border-bottom: none;
}

.po-show-page table.listing-grid.po-show-items-table td:first-child,
.po-show-page table.listing-grid.po-show-items-table td:nth-child(2) {
  white-space: normal;
  max-width: 220px;
}

.po-show-totals {
  margin-top: 14px;
  margin-left: auto;
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.po-show-totals__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  color: #475569;
}

.po-show-totals__row--grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  color: #0f172a;
  font-size: 0.9375rem;
}

.bom-show-page table.data-table.bom-show-items-table .col-desc,
.bom-show-page table.data-table.bom-show-items-table .col-item {
  white-space: normal;
}

.bom-show-page .bom-item-name {
  font-weight: 600;
  color: #111827;
}

.bom-show-page .empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 18px 12px !important;
}

@media (max-width: 900px) {
  .bom-show-page .bom-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .bom-show-page .bom-form-grid {
    grid-template-columns: 1fr;
  }
}

.detail-rows {
  margin: 0;
  padding: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.detail-row dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-strongest);
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 768px) {
  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 16px;
  }
}

@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-grid--projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .cards-grid--projects { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 900;
  }

  .app-shell.sidebar-mobile-open .sidebar-backdrop {
    display: block;
  }

  .app-shell {
    flex-direction: row;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    width: min(var(--sidebar-width), 88vw) !important;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .app-shell.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: min(var(--sidebar-width), 88vw) !important;
  }

  .app-shell.sidebar-collapsed .brand-name,
  .app-shell.sidebar-collapsed .nav-section-title,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .sidebar-user-label,
  .app-shell.sidebar-collapsed .sidebar-logout-btn {
    opacity: 1;
    width: auto;
    height: auto;
    pointer-events: auto;
    margin: initial;
    padding: initial;
  }

  .app-shell.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 10px 12px;
    gap: 10px;
  }

  .app-shell.sidebar-collapsed .btn-logout-icon {
    display: none;
  }

  .main {
    width: 100%;
  }

  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

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

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .company-badge {
    max-width: 100%;
    flex: 1;
    justify-content: center;
  }

  .content {
    padding: 16px;
  }

  .kpi-grid,
  .cards-grid,
  .two-col,
  .form-grid,
  .show-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

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

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn,
  .toolbar-actions select,
  .toolbar-actions form,
  .toolbar-actions .erp-filter-form {
    width: 100%;
  }

  /* Keep listing tables as real tables; scroll horizontally instead of stacking into cards */
  table.data-table.responsive-stack {
    min-width: max-content;
  }

  table.data-table.responsive-stack thead {
    display: table-header-group;
  }

  table.data-table.responsive-stack tr {
    display: table-row;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  table.data-table.responsive-stack td {
    display: table-cell;
    justify-content: initial;
    gap: 0;
  }

  table.data-table.responsive-stack td::before {
    content: none;
  }

  table.data-table.responsive-stack td.actions {
    flex-direction: initial;
    align-items: initial;
  }

  table.data-table.responsive-stack td.actions::before {
    content: none;
  }

  .users-table,
  table.erp-users-table {
    min-width: 0;
  }

  .erp-page-card__header {
    padding: 14px 16px;
  }

  .erp-page-card__title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .card-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions .btn,
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Keep action buttons inline in listing rows; scroll horizontally instead */
  table.data-table .actions {
    width: 160px;
  }
}

/* Address Master */
.search-form {
  margin: 0;
}

.search-input {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 0.875rem;
  min-width: 220px;
  background: var(--color-surface);
  color: var(--color-text);
}

.search-input:focus {
  outline: 2px solid var(--color-focus-ring);
  border-color: var(--color-brand-primary);
  background: var(--color-surface);
}

.address-form .field label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #475569;
  font-weight: 700;
}

.address-form .supplier-picker,
.address-form .item-picker {
  width: 100%;
}

.address-form .supplier-picker-input,
.address-form .item-picker-input {
  width: 100%;
}

.form-card .supplier-picker-input,
.form-card .item-picker-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  background-color: #f8fafc;
  box-sizing: border-box;
}

.address-form .required {
  color: var(--color-danger);
}

/* Vendor form */
.vendor-form .field label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #475569;
  font-weight: 700;
}

.vendor-form .required {
  color: var(--color-danger);
}

.vendor-form textarea {
  resize: vertical;
  min-height: 72px;
}

.vendor-show-page {
  max-width: 960px;
}

.vendor-show .readonly-field {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  background: var(--color-surface-subtle);
  color: var(--color-text-strongest);
  word-break: break-word;
}

.vendor-show .readonly-field--multiline {
  min-height: 72px;
  white-space: pre-wrap;
}

.vendor-show .readonly-field--multiline p {
  margin: 0;
}

.vendor-show .readonly-field--badge {
  display: flex;
  align-items: center;
  background: var(--color-surface);
}

.vendor-show .readonly-field--actions {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  padding: 8px 10px;
}

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

.attachment-preview-btn {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-modal .attachment-preview-dialog {
  width: min(100%, 960px);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.attachment-preview-body {
  flex: 1;
  min-height: 60vh;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.attachment-preview-frame {
  width: 100%;
  height: min(72vh, 820px);
  border: 0;
  background: #fff;
}

.attachment-preview-image {
  max-width: 100%;
  max-height: min(72vh, 820px);
  object-fit: contain;
  display: block;
}

.attachment-preview-fallback {
  color: #e2e8f0;
  text-align: center;
  padding: 24px;
  font-size: 0.9375rem;
}

.attachment-preview-fallback p {
  margin: 0 0 8px;
}

.vendor-show .attachment-empty {
  color: var(--color-text-muted);
  font-weight: 400;
}

.attachments-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.attachments-title {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-brand-navy);
}

.attachments-note {
  margin: 0 0 14px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: 6px;
  padding: 8px 10px;
}

.attachment-empty,
.attachment-current {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* BOM / PO / GRN forms — matches RFQ soft-gray field theme */
.erp-page-card.bom-form-page,
.erp-page-card.bom-details-page,
.erp-page-card.po-form-page,
.erp-page-card.grn-form-page {
  overflow: visible;
  max-width: none;
  width: 100%;
}

.bom-form-card {
  max-width: none;
  width: 100%;
}

/* BOM form — boxed layout matching Supplier Quotation */
.bom-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.bom-upload-card {
  margin-bottom: 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.bom-upload-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bom-upload-card__head h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #0f172a;
}

.bom-upload-card__hint {
  margin: 0;
  max-width: 720px;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.45;
}

.bom-upload-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bom-upload-preview-banner {
  margin-bottom: 14px;
}

.bom-item-line--unmatched td {
  background: #fef2f2 !important;
}

.bom-item-line--unmatched:hover td {
  background: #fee2e2 !important;
}

.bom-item-input--unmatched {
  border-color: #dc2626 !important;
  background: #fff5f5 !important;
  color: #991b1b !important;
}

.bom-item-unmatched-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  color: #b91c1c;
}

.bom-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  padding: 22px 24px 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

.bom-box__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.bom-box__section {
  margin-bottom: 18px;
}

.bom-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

.bom-form .field {
  margin: 0;
}

.bom-components-box {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 0;
  max-width: 100%;
}

.bom-components-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #d1d5db;
  background: #edf2f7;
  border-radius: 10px 10px 0 0;
}

.bom-components-head h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
}

.bom-components-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bom-components-head__actions .bom-components-btn {
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.bom-components-head__actions .bom-components-btn:hover {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

.bom-components-head__actions .bom-components-btn--add-row {
  color: #1e40af;
  background: #fff;
  border-color: #93c5fd;
}

.bom-components-head__actions .bom-components-btn--add-row:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.item-modal__dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}

.item-modal__subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.item-modal__body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.item-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.item-modal__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.item-modal__field label .required {
  color: #dc2626;
}

.item-modal__input,
.item-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 1.4;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.item-modal__input {
  min-height: 40px;
  padding: 9px 12px;
}

.item-modal__textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
}

.item-modal__input:focus,
.item-modal__textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.item-modal__errors {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
}

.item-modal__errors ul {
  margin: 0;
  padding-left: 18px;
}

.item-modal__footer {
  justify-content: flex-end;
  padding: 16px 22px;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .item-modal__grid {
    grid-template-columns: 1fr;
  }
}

.bom-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 4px;
}

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

@media (max-width: 640px) {
  .bom-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-card-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-brand-navy);
}

.bom-form .field label,
.po-form .field label,
.grn-form .field label,
.bom-form .line-items h3,
.po-form .line-items h3,
.grn-form .line-items h3 {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #475569;
  font-weight: 700;
}

.bom-form .required,
.po-form .required,
.grn-form .required {
  color: var(--color-danger);
}

.bom-form .form-grid,
.po-form .form-grid,
.grn-form .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 20px;
}

.bom-form .bom-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  margin-bottom: 0;
}

.bom-form .field input[type="text"],
.po-form .field input[type="text"],
.grn-form .field input[type="text"],
.bom-form .field input[type="number"],
.po-form .field input[type="number"],
.grn-form .field input[type="number"],
.bom-form .field input[type="date"],
.po-form .field input[type="date"],
.grn-form .field input[type="date"],
.bom-form .field input[type="email"],
.po-form .field input[type="email"],
.grn-form .field input[type="email"],
.bom-form .field input[type="file"],
.po-form .field input[type="file"],
.grn-form .field input[type="file"],
.bom-form .field select,
.po-form .field select,
.grn-form .field select,
.bom-form .field textarea,
.po-form .field textarea,
.grn-form .field textarea,
.bom-form .readonly-field,
.po-form .readonly-field,
.grn-form .readonly-field,
.bom-form .item-picker-input,
.po-form .item-picker-input,
.grn-form .item-picker-input,
.bom-form .bom-components-table input[type="text"],
.po-form .po-items-table input[type="text"],
.grn-form .grn-items-table input[type="text"],
.bom-form .bom-components-table input[type="number"],
.po-form .po-items-table input[type="number"],
.grn-form .grn-items-table input[type="number"],
.bom-form .bom-components-table input[type="file"],
.po-form .po-items-table input[type="file"],
.grn-form .grn-items-table input[type="file"],
.bom-form .bom-components-table select,
.po-form .po-items-table select,
.grn-form .grn-items-table select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.bom-form .field textarea,
.po-form .field textarea,
.grn-form .field textarea {
  min-height: 84px;
  resize: vertical;
}

.bom-form .field input::placeholder,
.po-form .field input::placeholder,
.grn-form .field input::placeholder,
.bom-form .item-picker-input::placeholder,
.po-form .item-picker-input::placeholder,
.grn-form .item-picker-input::placeholder,
.bom-form .bom-components-table input::placeholder,
.po-form .po-items-table input::placeholder,
.grn-form .grn-items-table input::placeholder {
  color: #94a3b8;
}

.bom-form .field input:focus,
.po-form .field input:focus,
.grn-form .field input:focus,
.bom-form .field select:focus,
.po-form .field select:focus,
.grn-form .field select:focus,
.bom-form .field textarea:focus,
.po-form .field textarea:focus,
.grn-form .field textarea:focus,
.bom-form .item-picker-input:focus,
.po-form .item-picker-input:focus,
.grn-form .item-picker-input:focus,
.bom-form .bom-components-table input:focus,
.po-form .po-items-table input:focus,
.grn-form .grn-items-table input:focus,
.bom-form .bom-components-table select:focus,
.po-form .po-items-table select:focus,
.grn-form .grn-items-table select:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.bom-form .readonly-field,
.po-form .readonly-field,
.grn-form .readonly-field,
.bom-form .bom-components-table input[readonly],
.po-form .po-items-table input[readonly],
.grn-form .grn-items-table input[readonly] {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: default;
}

.bom-form .field select:disabled,
.po-form .field select:disabled,
.grn-form .field select:disabled,
.bom-form select:disabled,
.po-form select:disabled,
.grn-form select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.bom-components,
.bom-components-box,
.po-line-items,
.grn-line-items,
.inventory-line-items {
  margin-top: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
}

.bom-components-box {
  margin-top: 0;
}

.bom-components .line-items-header,
.po-line-items .line-items-header,
.grn-line-items .line-items-header,
.inventory-line-items .line-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #edf2f7;
  border-radius: 10px 10px 0 0;
}

.grn-line-items .line-items-header {
  align-items: flex-start;
}

.bom-components .line-items-header h3,
.po-line-items .line-items-header h3,
.grn-line-items .line-items-header h3 {
  margin: 0;
}

.grn-line-items .line-items-header .grn-machine-field {
  margin-top: 10px;
  max-width: 420px;
}

.grn-line-items .line-items-header .grn-machine-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.grn-line-items .line-items-header .grn-machine-field select {
  width: 100%;
}

.grn-item-group {
  box-shadow: inset 4px 0 0 #6366f1;
}

.grn-item-group + .grn-item-group .grn-item-group-status td {
  border-top: 8px solid #475569 !important;
  padding-top: 12px !important;
}

.grn-item-group .grn-item-group-status td {
  border-bottom: 8px solid #475569 !important;
  padding-bottom: 12px !important;
  box-shadow: inset 0 -1px 0 #cbd5e1;
}

.grn-item-group .grn-item-primary td {
  border-top: none !important;
}

.grn-item-group:nth-of-type(even) .grn-item-primary td {
  background: #fafbff;
}

.grn-item-primary td {
  background: #fff;
  border-top: 1px solid #e2e8f0 !important;
}

.grn-item-clubbed td {
  background: #f1f5f9;
}

.grn-item-clubbed td.col-item {
  border-left: none !important;
}

.grn-cell-muted {
  color: #94a3b8;
}

.grn-cell-truncate,
.grn-form table.data-table.grn-items-table td.col-item .item-picker-input,
.grn-form table.data-table.grn-items-table td.col-desc .grn-cell-static,
.grn-form table.data-table.grn-items-table td.col-desc input.grn-cell-static {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.grn-item-group-status--over-remaining td {
  background: #fef2f2 !important;
  border-top-color: #fecaca !important;
}

.grn-qty-over-remaining {
  color: #b91c1c;
}

.grn-item-group-status--over-remaining .grn-allocation-error {
  color: #b91c1c;
  font-weight: 600;
}

.grn-item-group-status td {
  background: #eef2ff;
  padding: 10px 14px !important;
  border-top: 2px solid #c7d2fe !important;
}

.grn-item-group-status__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 0.8125rem;
}

.grn-item-group-status__summary {
  color: #475569;
}

.grn-item-group-status--error td {
  background: #fef2f2;
  border-top-color: #fecaca;
}

.grn-item-group-status--ok td {
  background: #ecfdf5;
  border-top-color: #a7f3d0;
}

.grn-allocation-error {
  color: #b91c1c;
  font-weight: 600;
}

.grn-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  white-space: normal;
}

.grn-show-form table.data-table.grn-show-items-table {
  min-width: 1480px !important;
}

.grn-show-form table.data-table.grn-show-items-table td.col-item .grn-cell-static,
.grn-show-form table.data-table.grn-show-items-table td.col-desc .grn-cell-static {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.grn-show-form tbody.grn-item-group tr:last-child td {
  border-bottom: 8px solid #475569 !important;
  padding-bottom: 14px !important;
}

.grn-show-form .grn-show-item-group-status td {
  background: #eef2ff !important;
}

.grn-col-inr {
  display: none;
}

.grn-form--foreign-currency .grn-col-inr {
  display: table-cell;
}

.grn-form--foreign-currency col.grn-col-inr {
  display: table-column;
}

.grn-cell-inr {
  color: #0f766e;
  font-weight: 600;
}

.grn-form-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px 28px;
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.grn-form-totals__row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.grn-form-totals__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.grn-show-allocations-row td {
  background: #f8fafc;
  padding-top: 0 !important;
}

.grn-show-allocations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.8125rem;
}

.grn-show-allocation-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.bom-form .form-actions,
.bom-form .bom-form-actions,
.po-form .form-actions,
.grn-form .form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.bom-components-table-wrap,
.po-items-table-wrap,
.grn-items-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.bom-form .bom-components-table-wrap {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-top: none;
}

/* Fit BOM lines inside the card — never expand past the box */
.bom-form table.data-table.bom-components-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed !important;
  background: #fff;
}

.bom-form table.data-table.bom-components-table th,
.bom-form table.data-table.bom-components-table td {
  overflow: hidden;
  max-width: 0;
  white-space: nowrap;
}

.bom-form table.data-table.bom-components-table .item-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bom-form table.data-table.bom-components-table .item-picker-input,
.bom-form table.data-table.bom-components-table input[type="text"],
.bom-form table.data-table.bom-components-table input[type="number"],
.bom-form table.data-table.bom-components-table input[type="file"],
.bom-form table.data-table.bom-components-table .bom-file-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.bom-form table.data-table.bom-components-table .col-item { width: 22%; }
.bom-form table.data-table.bom-components-table .col-desc { width: 18%; }
.bom-form table.data-table.bom-components-table .col-qty { width: 8%; }
.bom-form table.data-table.bom-components-table .col-uom { width: 8%; }
.bom-form table.data-table.bom-components-table .col-rate { width: 10%; }
.bom-form table.data-table.bom-components-table .col-amount { width: 10%; }
.bom-form table.data-table.bom-components-table .col-attach { width: 12%; }
.bom-form table.data-table.bom-components-table .col-windows { width: 12%; min-width: 130px; }
.bom-form table.data-table.bom-components-table .col-actions { width: 90px; min-width: 90px; }

.bom-item-windows {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  vertical-align: middle;
}

.bom-item-row-action {
  vertical-align: middle;
  white-space: nowrap;
  text-align: center;
}

.bom-row-delete-btn {
  min-width: 72px;
}

.bom-item-windows .bom-schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.bom-schedule-modal__dialog {
  max-width: 1100px;
  width: min(1100px, calc(100vw - 2rem));
}

.bom-schedule-modal__body {
  padding: 1.25rem 1.5rem;
  max-height: min(75vh, 780px);
  overflow-y: auto;
}

.bom-schedule-period-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  font-size: 0.9375rem;
}

.bom-schedule-modal__summary {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.5;
}

.bom-schedule-modal__rate-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #64748b;
}

.bom-schedule-table--simple {
  margin-bottom: 1rem;
  table-layout: fixed;
  width: 100%;
}

.bom-schedule-table--simple th {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
}

.bom-schedule-table--simple td {
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
}

.bom-schedule-table--simple .col-year {
  width: 10%;
}

.bom-schedule-table--simple .col-month {
  width: 14%;
}

.bom-schedule-table--simple .col-window {
  width: 24%;
}

.bom-schedule-table--simple .col-qty,
.bom-schedule-table--simple td.col-qty,
.bom-schedule-table--simple th.col-qty {
  width: 24%;
  min-width: 180px;
}

.bom-schedule-table--simple .col-amount {
  width: 12%;
  min-width: 96px;
}

.bom-schedule-table--simple .col-actions {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.bom-schedule-table--simple .col-actions .btn {
  width: 100%;
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  white-space: nowrap;
}

.bom-schedule-row--destroyed {
  display: none !important;
}

.bom-schedule-table--simple .bom-schedule-year-select,
.bom-schedule-table--simple .bom-schedule-month-select,
.bom-schedule-table--simple .bom-schedule-window-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  font-size: 0.9375rem;
}

.bom-schedule-table--simple .bom-schedule-qty-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  min-width: 168px;
  min-height: 46px;
  padding: 0.6rem 0.9rem;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.bom-schedule-modal__footer {
  padding: 1rem 1.5rem;
}

.bom-schedule-open-btn {
  white-space: nowrap;
}

.bom-schedule-modal__subtitle {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
}

.bom-schedule-add-btn {
  margin-top: 0.75rem;
  cursor: pointer;
}

.bom-schedule-allocation-badge {
  font-size: 0.75rem;
  color: #047857;
  font-weight: 600;
}

.bom-schedule-allocation-badge--empty {
  color: #94a3b8;
  font-weight: 500;
}

.bom-form table.data-table.bom-components-table .col-total-qty {
  width: 8%;
  white-space: nowrap;
}

.bom-form table.data-table.bom-components-table .col-total-amount {
  width: 9%;
  white-space: nowrap;
}

.bom-schedule-panel__summary--over {
  color: #b45309;
  font-weight: 600;
}

.bom-schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.bom-schedule-table th,
.bom-schedule-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.bom-schedule-table .col-window {
  min-width: 0;
}

.bom-schedule-table--simple .col-window {
  min-width: 0;
}

.bom-schedule-window-select {
  width: 100%;
  min-width: 0;
}

.bom-components-table,
.po-items-table,
.grn-items-table {
  margin: 0;
  border: none;
}

.bom-components-table thead th,
.po-items-table thead th,
.grn-items-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  background: #edf2f7;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.bom-components-table td,
.po-items-table td,
.grn-items-table td {
  vertical-align: middle;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.bom-components-table tbody tr:last-child td,
.po-items-table tbody tr:last-child td {
  border-bottom: none;
}

.bom-components-table .col-item,
.po-items-table .col-item,
.grn-items-table .col-item { min-width: 220px; width: 22%; }
.bom-components-table .col-desc,
.po-items-table .col-desc,
.grn-items-table .col-desc { min-width: 180px; width: 20%; }
.bom-components-table .col-qty,
.po-items-table .col-qty,
.grn-items-table .col-qty { min-width: 80px; width: 8%; }
.grn-items-table .col-ordered,
.grn-items-table .col-received,
.grn-items-table .col-remaining { min-width: 90px; width: 8%; }
.grn-items-table .grn-po-qty {
  background: var(--surface-muted, #f5f6f8);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.bom-components-table .col-uom,
.po-items-table .col-uom,
.grn-items-table .col-uom { min-width: 72px; width: 5%; }
.bom-components-table .col-rate,
.po-items-table .col-rate,
.grn-items-table .col-rate { min-width: 100px; width: 10%; }
.bom-components-table .col-amount,
.po-items-table .col-amount,
.grn-items-table .col-amount { min-width: 100px; width: 10%; }
.bom-components-table .col-attach,
.po-items-table .col-attach,
.grn-items-table .col-attach { min-width: 140px; width: 16%; }
.bom-components-table .col-condition,
.grn-items-table .col-condition { min-width: 110px; width: 10%; }
.bom-form .bom-components-table .col-windows { min-width: 130px; width: 12%; }
.bom-form .bom-components-table .col-actions { min-width: 90px !important; width: 90px !important; }
.po-items-table .col-actions,
.grn-items-table .col-actions { width: 70px; }
.bom-components-table .col-actions { width: 70px; }

/* GRN items table — grid rows/cols with aligned headers */
.grn-items-table-wrap {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid #d1d5db;
  scrollbar-gutter: stable;
}

.grn-items-table-wrap::-webkit-scrollbar {
  height: 12px;
}

.grn-items-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.grn-items-table-wrap::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.grn-form table.data-table.grn-items-table,
.grn-form table.data-table.grn-grid-table {
  display: table !important;
  width: 100% !important;
  min-width: 1780px !important;
  max-width: 100%;
  margin: 0;
  border: 1px solid #d1d5db;
  border-top: none;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  background: #fff;
}

.grn-form table.data-table.grn-items-table th,
.grn-form table.data-table.grn-items-table td,
.grn-form table.data-table.grn-grid-table th,
.grn-form table.data-table.grn-grid-table td {
  padding: 10px 12px !important;
  height: auto !important;
  overflow: hidden;
  max-width: 0;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid #e2e8f0 !important;
  box-sizing: border-box;
}

.grn-form table.data-table.grn-items-table thead th,
.grn-form table.data-table.grn-grid-table thead th {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  background: #edf2f7 !important;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid #cbd5e1 !important;
}

.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group tr:nth-child(even) td {
  background: inherit;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-primary td {
  background: #fff;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group:nth-of-type(even) .grn-item-primary td {
  background: #fafbff;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-clubbed td {
  background: #f1f5f9 !important;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group + tbody.grn-item-group .grn-item-group-status td {
  border-top: 8px solid #475569 !important;
  padding-top: 12px !important;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-group-status td {
  border-bottom: 8px solid #475569 !important;
  padding-bottom: 12px !important;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-primary td {
  border-top: none !important;
}

.grn-form table.data-table.grn-items-table tbody tr:hover td,
.grn-form table.data-table.grn-grid-table tbody tr:hover td {
  background: #f1f5f9;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-primary:hover td {
  background: #f8fafc !important;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-clubbed:hover td {
  background: #e8edf5 !important;
}

.grn-form table.data-table.grn-items-table tbody.grn-item-group .grn-item-group-status:hover td {
  background: #eef2ff !important;
}

.grn-form table.data-table.grn-items-table tbody tr:last-child td,
.grn-form table.data-table.grn-grid-table tbody tr:last-child td {
  border-bottom: 1px solid #e2e8f0 !important;
}

.grn-form table.data-table.grn-items-table td.col-ordered,
.grn-form table.data-table.grn-items-table td.col-received,
.grn-form table.data-table.grn-items-table td.col-remaining,
.grn-form table.data-table.grn-items-table td.col-desc,
.grn-form table.data-table.grn-items-table td.col-amount,
.grn-form table.data-table.grn-grid-table td.col-ordered,
.grn-form table.data-table.grn-grid-table td.col-received,
.grn-form table.data-table.grn-grid-table td.col-remaining,
.grn-form table.data-table.grn-grid-table td.col-desc,
.grn-form table.data-table.grn-grid-table td.col-amount {
  background: #f1f5f9;
}

.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td.col-ordered,
.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td.col-received,
.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td.col-remaining,
.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td.col-desc,
.grn-form table.data-table.grn-items-table tbody tr:nth-child(even) td.col-amount,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td.col-ordered,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td.col-received,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td.col-remaining,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td.col-desc,
.grn-form table.data-table.grn-grid-table tbody tr:nth-child(even) td.col-amount {
  background: #eef2f6;
}

.grn-form table.data-table.grn-items-table .item-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.grn-form table.data-table.grn-items-table .item-picker-input,
.grn-form table.data-table.grn-items-table input[type="text"],
.grn-form table.data-table.grn-items-table input[type="number"],
.grn-form table.data-table.grn-items-table select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.grn-form table.data-table.grn-items-table col.col-item,
.grn-form table.data-table.grn-items-table .col-item {
  width: 18%;
  min-width: 280px !important;
}

.grn-form table.data-table.grn-items-table col.col-desc,
.grn-form table.data-table.grn-items-table .col-desc {
  width: 14%;
  min-width: 200px !important;
}

.grn-form table.data-table.grn-items-table col.col-ordered,
.grn-form table.data-table.grn-items-table .col-ordered {
  width: 5%;
  min-width: 68px !important;
}

.grn-form table.data-table.grn-items-table col.col-received,
.grn-form table.data-table.grn-items-table .col-received {
  width: 7%;
  min-width: 92px !important;
}

.grn-form table.data-table.grn-items-table col.col-remaining,
.grn-form table.data-table.grn-items-table .col-remaining {
  width: 5%;
  min-width: 72px !important;
}

.grn-form table.data-table.grn-items-table col.col-machine,
.grn-form table.data-table.grn-items-table .col-machine {
  width: 14%;
  min-width: 190px !important;
}

.grn-form table.data-table.grn-items-table col.col-qty,
.grn-form table.data-table.grn-items-table .col-qty {
  width: 6%;
  min-width: 84px !important;
}

.grn-form table.data-table.grn-items-table col.col-condition,
.grn-form table.data-table.grn-items-table .col-condition {
  width: 7%;
  min-width: 96px !important;
}

.grn-form table.data-table.grn-items-table col.col-uom,
.grn-form table.data-table.grn-items-table .col-uom {
  width: 5%;
  min-width: 72px !important;
}

.grn-form table.data-table.grn-items-table col.col-rate,
.grn-form table.data-table.grn-items-table .col-rate {
  width: 8%;
  min-width: 104px !important;
}

.grn-form table.data-table.grn-items-table col.col-amount,
.grn-form table.data-table.grn-items-table .col-amount {
  width: 8%;
  min-width: 104px !important;
}

.grn-form table.data-table.grn-items-table col.col-inr,
.grn-form table.data-table.grn-items-table .col-inr {
  width: 0;
  min-width: 0 !important;
}

.grn-form--foreign-currency table.data-table.grn-items-table col.col-inr,
.grn-form--foreign-currency table.data-table.grn-items-table .col-inr {
  width: 8%;
  min-width: 104px !important;
}

.grn-form table.data-table.grn-items-table col.col-actions,
.grn-form table.data-table.grn-items-table .col-actions {
  width: 12%;
  min-width: 168px !important;
}

.grn-form table.data-table.grn-items-table td.col-item,
.grn-form table.data-table.grn-items-table td.col-desc,
.grn-form table.data-table.grn-items-table td.col-machine,
.grn-form table.data-table.grn-items-table td.col-uom,
.grn-form table.data-table.grn-items-table td.col-rate,
.grn-form table.data-table.grn-items-table td.col-amount,
.grn-form table.data-table.grn-items-table th.col-item,
.grn-form table.data-table.grn-items-table th.col-desc,
.grn-form table.data-table.grn-items-table th.col-machine,
.grn-form table.data-table.grn-items-table th.col-uom,
.grn-form table.data-table.grn-items-table th.col-rate,
.grn-form table.data-table.grn-items-table th.col-amount,
.grn-form table.data-table.grn-items-table th.col-received,
.grn-form table.data-table.grn-items-table th.col-actions {
  max-width: none !important;
  overflow: visible;
  white-space: normal;
  line-height: 1.35;
}

.grn-form table.data-table.grn-items-table td.col-actions,
.grn-form table.data-table.grn-grid-table td.col-actions {
  text-align: center;
  white-space: normal;
}

/* Editable GRN line inputs — white background, clear border */
.grn-form .grn-items-table .grn-input-editable,
.grn-form .grn-items-table .item-picker-input {
  background-color: #fff !important;
  border: 1px solid #94a3b8 !important;
  border-radius: 6px;
  color: #111827;
  min-height: 34px;
}

.grn-form .grn-items-table td.num .grn-input-editable {
  text-align: right;
}

.grn-form .grn-items-table .grn-input-editable:focus,
.grn-form .grn-items-table .item-picker-input:focus {
  background-color: #fff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* Read-only GRN cells — plain text, not input boxes */
.grn-form .grn-items-table input.grn-cell-static[data-allocation-qty] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: default;
  padding-left: 0;
  padding-right: 0;
}

.grn-form .grn-items-table .grn-cell-static,
.grn-form .grn-items-table input.grn-cell-static {
  display: block;
  width: 100%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
  color: #475569;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grn-form .grn-items-table .grn-cell-num,
.grn-form .grn-items-table input.grn-cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: #334155;
}

.grn-form table.data-table.grn-items-table th.num,
.grn-form table.data-table.grn-grid-table th.num {
  text-align: right;
  padding-right: 12px !important;
}

.grn-form table.data-table.grn-items-table td.num,
.grn-form table.data-table.grn-grid-table td.num {
  text-align: right;
  padding-right: 12px !important;
}

/* Top form fields — editable inputs look interactive */
.grn-form .form-grid input:not(.readonly-field):not([readonly]),
.grn-form .form-grid select:not(:disabled),
.grn-form .form-grid .item-picker-input {
  background-color: #fff;
  border-color: #cbd5e1;
}

.grn-form,
.grn-form .erp-page-card__body--form {
  min-width: 0;
  max-width: 100%;
}

/* Inventory Out / Return — BOM-style components table */
.inventory-components-box {
  margin-top: 18px;
}

.bom-form-grid__full {
  grid-column: 1 / -1;
}

.inventory-lines-error {
  margin: 10px 16px 0;
}

.bom-form.inventory-out-form table.data-table.inventory-lines-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed !important;
  background: #fff;
}

.bom-form.inventory-out-form table.data-table.inventory-lines-table th,
.bom-form.inventory-out-form table.data-table.inventory-lines-table td {
  overflow: hidden;
  max-width: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-item {
  width: 20%;
  min-width: 220px !important;
  max-width: none !important;
  overflow: visible;
  white-space: normal;
}

.bom-form.inventory-out-form table.data-table.inventory-out-lines-table td.col-item .item-picker-input {
  min-width: 0;
}

.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-machine { width: 16%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-available { width: 11%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-qty { width: 10%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-returnable { width: 11%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-return-date { width: 14%; min-width: 120px !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-uom { width: 10%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-out-lines-table .col-actions { width: 10%; min-width: 0 !important; }

.inventory-out-general-box {
  margin-top: 1.25rem;
}

.inventory-mobile-lines {
  display: none;
  margin: 0 0 12px;
}

.inventory-mobile-lines__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inventory-mobile-lines__empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

.inventory-mobile-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.inventory-mobile-line__main {
  flex: 1;
  min-width: 0;
}

.inventory-mobile-line__title {
  display: block;
  font-size: 0.9375rem;
  color: var(--color-text-strongest);
  margin-bottom: 4px;
  word-break: break-word;
}

.inventory-mobile-line__meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.inventory-mobile-line__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.inventory-mobile-lines__add {
  width: 100%;
  justify-content: center;
}

.inventory-line-editor-modal__dialog {
  width: min(100%, 480px);
  max-height: calc(100vh - 32px);
}

.inventory-line-editor-modal__body {
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.inventory-line-editor-error {
  margin: 0 0 12px;
}

.inventory-line-editor-staging tr[data-inventory-out-form-target="line"] {
  display: block !important;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.inventory-line-editor-staging tr[data-inventory-out-form-target="line"] td {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 0 14px !important;
  border: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-align: left !important;
}

.inventory-line-editor-staging tr[data-inventory-out-form-target="line"] td[data-label]::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.inventory-line-editor-staging tr[data-inventory-out-form-target="line"] td.actions {
  display: none !important;
}

.inventory-line-editor-staging .item-picker-input,
.inventory-line-editor-staging input,
.inventory-line-editor-staging select,
.inventory-line-editor-staging textarea {
  width: 100% !important;
  max-width: 100% !important;
}

.inventory-line-editor-staging .inventory-item-with-availability {
  flex-direction: column;
  align-items: stretch;
}

.inventory-returnable-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.inventory-returnable-check input[type="checkbox"] {
  margin: 0;
}

.bom-form.inventory-out-form table.data-table.inventory-out-lines-table td.col-return-date input[type="date"] {
  width: 100%;
  min-width: 0;
}

.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-item { width: 28%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-available { width: 12%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-rate { width: 12%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-qty { width: 12%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-return-condition { width: 14%; min-width: 120px !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-uom { width: 12%; min-width: 0 !important; }
.bom-form.inventory-out-form table.data-table.inventory-lines-table .col-actions { width: 10%; min-width: 0 !important; }

.bom-form.inventory-out-form table.data-table.inventory-lines-table th.num,
.bom-form.inventory-out-form table.data-table.inventory-lines-table td.num {
  text-align: right;
}

.bom-form.inventory-out-form table.data-table.inventory-lines-table .inventory-available-readonly,
.bom-form.inventory-out-form table.data-table.inventory-lines-table .inventory-rate-readonly,
.bom-form.inventory-out-form table.data-table.inventory-lines-table td.col-uom .readonly-field {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
  cursor: default;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.bom-form.inventory-out-form table.data-table.inventory-lines-table td.col-uom .readonly-field {
  text-align: left;
}

@media (max-width: 900px) {
  .bom-page:has(.inventory-out-form) .bom-box {
    padding: 16px;
  }

  .bom-page:has(.inventory-out-form) .bom-show-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .bom-page:has(.inventory-out-form) .bom-show-card__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .bom-page:has(.inventory-out-form) .bom-show-card__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

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

  .bom-form.inventory-out-form .inventory-components-box .bom-components-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .bom-form.inventory-out-form .inventory-components-box .bom-components-head > .btn {
    display: none;
  }

  .bom-form.inventory-out-form .bom-components-hint {
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .bom-form.inventory-out-form .inventory-lines-desktop {
    display: none !important;
  }

  .bom-form.inventory-out-form .inventory-mobile-lines {
    display: block;
  }

  .bom-form.inventory-out-form .bom-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .bom-form.inventory-out-form .bom-form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.inventory-return-lines-table .col-scope {
  min-width: 90px;
}

.inventory-item-with-availability {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow: visible;
}

.inventory-item-with-availability .item-picker {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.bom-form.inventory-out-form .inventory-lines-table-wrap {
  overflow: visible;
}

.bom-form.inventory-out-form .inventory-out-lines-table .item-picker-results {
  z-index: 5000;
  min-width: 100%;
  max-width: min(420px, 90vw);
}

.inventory-availability-btn {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inventory-availability-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.inventory-availability-modal {
  z-index: 210;
}

.inventory-line-editor-modal {
  z-index: 200;
}

.inventory-availability-modal__dialog {
  width: min(100%, 820px);
}

.inventory-availability-modal__body {
  min-height: 120px;
}

.inventory-availability-modal__loading {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.inventory-availability-summary {
  margin: 0;
  display: grid;
  gap: 10px;
}

.inventory-availability-summary__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}

.inventory-availability-summary__row dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.inventory-availability-summary__row dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
}

.inventory-availability-breakdown {
  margin-top: 18px;
}

.inventory-availability-empty {
  margin: 16px 0 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.inventory-availability-table th,
.inventory-availability-table td {
  font-size: 0.8125rem;
}

.bom-show-page .inventory-request-show-col-view {
  width: 52px;
  text-align: center;
}

.bom-show-page tr.inventory-request-line--insufficient {
  background: #fff7ed;
}

.bom-show-page .inventory-request-available-warn {
  color: #c2410c;
  font-weight: 700;
}

.cash-outflow-modal__dialog {
  width: min(100% - 32px, 520px);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.cash-outflow-modal__header {
  align-items: flex-start;
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.cash-outflow-modal__subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
  font-weight: 500;
}

.cash-outflow-modal__body {
  padding: 16px 20px 20px;
  gap: 0;
}

.cash-outflow-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cash-outflow-modal__section {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.cash-outflow-modal__section-head {
  margin-bottom: 12px;
}

.cash-outflow-modal__section-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.cash-outflow-modal__section-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.cash-outflow-modal__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cash-outflow-modal__field--amount {
  flex: 0 1 280px;
  max-width: 100%;
}

.cash-outflow-modal__field label {
  display: block;
  margin-bottom: 6px;
  text-transform: none;
  font-size: 0.8125rem;
  letter-spacing: 0;
  color: #334155;
  font-weight: 600;
}

.cash-outflow-modal__optional {
  font-weight: 500;
  color: #94a3b8;
}

.cash-outflow-modal__field label .required {
  color: #dc2626;
}

.cash-outflow-modal__input,
.cash-outflow-modal__textarea,
.cash-outflow-modal .item-picker-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 1.4;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.cash-outflow-modal__input {
  min-height: 42px;
  padding: 10px 12px;
}

.cash-outflow-modal__select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

.cash-outflow-modal__input--amount {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
}

.cash-outflow-modal__input--date {
  padding: 9px 12px;
  color-scheme: light;
}

.cash-outflow-modal__input--date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
  padding: 4px;
  border-radius: 6px;
  transition: opacity 140ms ease, background-color 140ms ease;
}

.cash-outflow-modal__input--date::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: #f1f5f9;
}

.cash-outflow-modal__textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

.cash-outflow-modal__input::placeholder,
.cash-outflow-modal__textarea::placeholder,
.cash-outflow-modal .item-picker-input::placeholder {
  color: #94a3b8;
}

.cash-outflow-modal__input:focus,
.cash-outflow-modal__textarea:focus,
.cash-outflow-modal .item-picker-input:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.cash-outflow-modal__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cash-outflow-modal__grid--period {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
}

.cash-outflow-modal__grid--period .cash-outflow-modal__field {
  margin: 0;
}

.cash-outflow-modal__grid--period .cash-outflow-modal__field label {
  font-size: 0.78rem;
}

.cash-outflow-modal__errors {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8125rem;
}

.cash-outflow-modal__errors ul {
  margin: 0;
  padding-left: 18px;
}

.cash-outflow-modal__footer {
  justify-content: flex-end;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.cash-outflow-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.cash-outflow-modal__footer-actions .btn-outline {
  min-width: 88px;
  border-color: #cbd5e1;
  color: #334155;
  background: #fff;
}

.cash-outflow-modal .project-picker,
.cash-outflow-modal .item-picker {
  width: 100%;
}

.cash-outflow-modal .item-picker-results {
  border-radius: 10px;
  border-color: #cbd5e1;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

@media (max-width: 560px) {
  .cash-outflow-modal__grid,
  .cash-outflow-modal__grid--period {
    grid-template-columns: 1fr;
  }

  .cash-outflow-modal__field--amount {
    flex-basis: 100%;
  }
}

.cash-outflows-table tfoot td {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}

.cash-outflow-dashboard-kpi-grid {
  margin-bottom: 20px;
}

.cash-outflow-dashboard-kpi-grid .kpi-card {
  min-height: 118px;
}

.cash-outflow-dashboard-filters {
  margin-bottom: 18px;
}

.cash-outflow-dashboard-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.cash-outflow-dashboard-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cash-outflow-dashboard-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.cash-outflow-dashboard-range-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.cash-outflow-dashboard-page .cash-outflow-dashboard-table-wrap {
  overflow: auto;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  isolation: isolate;
}

.cash-outflow-dashboard-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.cash-outflow-dashboard-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 0 10px 10px;
}

.cash-outflow-dashboard-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}

.cash-outflow-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  background: #fff;
  margin: 0;
}

.cash-outflow-matrix-table th,
.cash-outflow-matrix-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: middle;
  background: #fff;
}

.cash-outflow-matrix-table th:last-child,
.cash-outflow-matrix-table td:last-child {
  border-right: none;
}

.cash-outflow-matrix-table thead th {
  background: #1e3a5f;
  color: #f8fafc;
  border-color: #2d4a73;
  vertical-align: bottom;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  position: static;
  top: auto;
  z-index: 1;
}

.cash-outflow-matrix-table thead th.num {
  text-align: right;
}

.cash-outflow-matrix-table tbody td.num,
.cash-outflow-matrix-table tfoot td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cash-outflow-matrix-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.cash-outflow-matrix-table tbody tr:hover td {
  background: #eef6ff;
}

.cash-outflow-matrix-table__project {
  min-width: 220px;
  max-width: 280px;
  width: 220px;
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
  box-shadow: 4px 0 10px -6px rgba(15, 23, 42, 0.28);
  border-right: 1px solid #cbd5e1 !important;
}

.cash-outflow-matrix-table thead th.cash-outflow-matrix-table__project {
  position: sticky;
  z-index: 6;
  left: 0;
  background: #1e3a5f !important;
  color: #f8fafc !important;
  box-shadow: 4px 0 10px -6px rgba(15, 23, 42, 0.45);
  border-right-color: #2d4a73 !important;
}

.cash-outflow-matrix-table tbody td.cash-outflow-matrix-table__project {
  position: sticky;
  left: 0;
}

.cash-outflow-matrix-table tfoot td.cash-outflow-matrix-table__project {
  position: sticky;
  z-index: 5;
  left: 0;
  background: #f1f5f9 !important;
  box-shadow: 4px 0 10px -6px rgba(15, 23, 42, 0.28);
}

.cash-outflow-matrix-table tbody tr:nth-child(even) td.cash-outflow-matrix-table__project {
  background: #f8fafc !important;
}

.cash-outflow-matrix-table tbody tr:hover td.cash-outflow-matrix-table__project {
  background: #eef6ff !important;
}

.cash-outflow-matrix-table__period {
  min-width: 118px;
  white-space: normal;
}

.cash-outflow-matrix-table__duration {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #cbd5e1 !important;
}

.cash-outflow-matrix-table__period-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  color: #f8fafc !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cash-outflow-matrix-table thead th.cash-outflow-matrix-table__total {
  background: #163049 !important;
  color: #f8fafc !important;
}

.cash-outflow-matrix-table__total {
  min-width: 118px;
}

.cash-outflow-matrix-table tfoot td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  font-weight: 700;
}

.cash-outflow-dashboard-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
}

@media (max-width: 768px) {
  .cash-outflow-modal__grid--period {
    grid-template-columns: 1fr;
  }
}

.inventory-stock-error-modal__dialog {
  width: min(100%, 920px);
}

.bom-schedule-validation-modal {
  z-index: 1300;
}

.bom-item-delete-modal {
  z-index: 1300;
}

.bom-schedule-validation-modal__dialog {
  width: min(100%, 720px);
}

.bom-schedule-validation-modal__body {
  max-height: min(70vh, 420px);
  overflow: auto;
}

.bom-schedule-validation-table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
}

.bom-schedule-validation-table {
  width: 100%;
}

.bom-schedule-validation-table th,
.bom-schedule-validation-table td {
  white-space: nowrap;
}

.bom-schedule-validation-table td:first-child {
  white-space: normal;
  min-width: 180px;
}

.bom-item-delete-modal__dialog {
  width: min(100%, 520px);
}

.inventory-stock-error-modal__body {
  max-height: min(70vh, 520px);
  overflow: auto;
}

.inventory-stock-error-modal__message {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 500;
}

.inventory-stock-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}

.inventory-stock-check-overlay[hidden] {
  display: none !important;
}

.inventory-stock-check-overlay__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 280px;
  padding: 28px 32px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.inventory-stock-check-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 160px;
  padding: 24px 16px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.inventory-stock-check-loading__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--color-brand-blue, #2563eb);
  border-radius: 50%;
  animation: inventory-stock-check-spin 0.8s linear infinite;
}

@keyframes inventory-stock-check-spin {
  to { transform: rotate(360deg); }
}

.inventory-stock-error-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.inventory-stock-error-table {
  min-width: 760px;
}

.inventory-stock-error-table th,
.inventory-stock-error-table td {
  font-size: 0.8125rem;
  vertical-align: top;
}

.inventory-stock-error-table td:first-child {
  min-width: 220px;
}

.inventory-stock-error-table__available {
  color: #c2410c;
  font-weight: 700;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table {
  table-layout: auto !important;
  min-width: 1080px;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table th,
.bom-form.inventory-out-form table.data-table.inventory-return-lines-table td {
  max-width: none !important;
  overflow: visible;
  white-space: normal;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-item {
  width: 20%;
  min-width: 160px !important;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-project {
  width: 16%;
  min-width: 140px !important;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-machine {
  width: 14%;
  min-width: 120px !important;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-qty {
  width: 8%;
  min-width: 72px !important;
  white-space: nowrap;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-return-condition {
  width: 14%;
  min-width: 120px !important;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table .col-uom {
  width: 10%;
  min-width: 72px !important;
}

.bom-form.inventory-out-form .inventory-return-lines-box .inventory-lines-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bom-form.inventory-out-form table.data-table.inventory-return-lines-table td.col-qty.num,
.bom-form.inventory-out-form table.data-table.inventory-return-lines-table th.num {
  text-align: right;
}

.bom-form table.data-table.bom-components-table .col-item,
.bom-form table.data-table.bom-components-table .col-desc,
.bom-form table.data-table.bom-components-table .col-qty,
.bom-form table.data-table.bom-components-table .col-total-qty,
.bom-form table.data-table.bom-components-table .col-total-amount,
.bom-form table.data-table.bom-components-table .col-uom,
.bom-form table.data-table.bom-components-table .col-rate,
.bom-form table.data-table.bom-components-table .col-amount,
.bom-form table.data-table.bom-components-table .col-attach {
  min-width: 0 !important;
}

.bom-form table.data-table.bom-components-table .col-windows {
  min-width: 130px !important;
}

.bom-form table.data-table.bom-components-table .col-actions {
  min-width: 90px !important;
  width: 90px !important;
}

.bom-form,
.bom-page,
.bom-box,
.bom-box__section,
.bom-components-box {
  min-width: 0;
  max-width: 100%;
}

.bom-page {
  overflow: hidden;
}

.bom-box {
  overflow: hidden;
}

.bom-file-input {
  width: 100%;
  max-width: 100%;
  font-size: 0.75rem;
  color: #64748b;
}

.content:has(.bom-page) {
  min-width: 0;
  overflow-x: hidden;
}

.bom-items-table {
  border: none;
}

.bom-items-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: #edf2f7;
  border-bottom: 1px solid var(--color-border);
  padding: 12px 14px;
  white-space: nowrap;
}

.bom-items-table tbody td {
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--color-text-strongest);
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.bom-items-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.bom-items-table tbody tr:hover {
  background: #f0f7ff;
}

.bom-items-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bom-item-name {
  font-weight: 600;
  color: var(--color-text-strongest);
}

.bom-items-table .empty-cell {
  text-align: center;
  color: var(--color-text-muted);
  padding: 28px 12px;
}

.bom-components-table .actions {
  text-align: center;
  white-space: nowrap;
}

/* Item search picker */
.item-picker {
  position: relative;
  z-index: 1;
}

.item-picker.is-open {
  z-index: 50;
}

.item-picker-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.875rem;
  background-color: #f8fafc;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
}

.item-picker-input:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.item-picker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 360px;
  z-index: 1000;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.item-picker-results--portal {
  position: fixed;
  z-index: 4000;
  min-width: 260px;
  max-width: 360px;
}

.item-picker-option {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-picker-option:hover,
.item-picker-option:focus {
  background: var(--color-brand-pale);
}

.item-picker-option--disabled,
.item-picker-option--disabled:hover,
.item-picker-option--disabled:focus {
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.item-picker-code {
  font-weight: 700;
  color: var(--color-brand-navy);
}

.item-picker-name {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.item-picker-empty {
  padding: 10px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  cursor: default;
}

.bom-components .table-wrap,
.po-line-items .table-wrap,
.grn-line-items .table-wrap,
.bom-components-table-wrap,
.po-items-table-wrap,
.grn-items-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bom-components table td {
  vertical-align: middle;
}

/* RFQ form */
.erp-page-card.rfq-form-page {
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  min-width: 0;
}

.rfq-form-page .page-subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.4;
}

.rfq-mail-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.form-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.form-hint code {
  font-size: 0.72rem;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
}

.form-hint.payment-amount-hint--warn,
.payment-amount-hint--warn {
  color: #b45309;
  font-weight: 600;
}


.checkbox-label input[type="hidden"] {
  display: none;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.mail-config-page {
  width: 100%;
  max-width: none;
}

.mail-config-page .mail-config-box {
  margin-bottom: 16px;
}

.mail-config-subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.mail-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.mail-config-grid__full {
  grid-column: 1 / -1;
}

.mail-config-form .field {
  margin: 0;
  min-width: 0;
}

.mail-config-form .field label:not(.checkbox-label) {
  display: block;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.mail-config-form .field input[type="text"],
.mail-config-form .field input[type="email"],
.mail-config-form .field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
}

.mail-config-form .field input:focus,
.mail-config-form .field textarea:focus {
  outline: none;
  background: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mail-config-smtp-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.mail-config-smtp-note code {
  font-size: 0.75rem;
  background: #fef3c7;
  padding: 1px 4px;
  border-radius: 4px;
}

.mail-log-table .mail-log-error {
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
  font-size: 0.75rem;
  color: #b91c1c;
}

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

.rfq-form .field label,
.rfq-form .line-items h3 {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #475569;
  font-weight: 700;
}

.rfq-form .required {
  color: var(--color-danger);
}

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

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

.rfq-form .rfq-supplier-error {
  margin: 10px 0 0;
}

/* Soft gray fields — distinct from white form background */
.rfq-form .field input[type="text"],
.rfq-form .field input[type="number"],
.rfq-form .field input[type="date"],
.rfq-form .field input[type="email"],
.rfq-form .field select,
.rfq-form .field textarea,
.rfq-form .item-picker-input,
.rfq-form .rfq-supplier-search,
.rfq-form .rfq-items-table input[type="text"],
.rfq-form .rfq-items-table input[type="number"],
.rfq-form .rfq-items-table input[type="file"],
.rfq-form .rfq-items-table select,
.rfq-form .rfq-suppliers-table input,
.rfq-form .rfq-suppliers-table select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.rfq-form .field textarea {
  min-height: 84px;
  resize: vertical;
}

.rfq-form .field input::placeholder,
.rfq-form .item-picker-input::placeholder,
.rfq-form .rfq-supplier-search::placeholder,
.rfq-form .rfq-items-table input::placeholder {
  color: #94a3b8;
}

.rfq-form .field input:focus,
.rfq-form .field select:focus,
.rfq-form .field textarea:focus,
.rfq-form .item-picker-input:focus,
.rfq-form .rfq-supplier-search:focus,
.rfq-form .rfq-items-table input:focus,
.rfq-form .rfq-items-table select:focus {
  outline: none;
  background: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rfq-form .rfq-items-table input.rfq-cell-editable {
  width: 100%;
  min-width: 0;
}

.rfq-form .rfq-items-table input.rfq-cell-readonly,
.rfq-form .rfq-items-table input[readonly]:not(.item-picker-input) {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
  cursor: default;
  box-shadow: none !important;
}

.rfq-form .rfq-items-table input.rfq-cell-readonly:focus {
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
  outline: none;
}

.rfq-form .field select:disabled,
.rfq-form select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.rfq-suppliers,
.rfq-items {
  margin-top: 22px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
  min-width: 0;
}

.rfq-form .line-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #edf2f7;
  border-radius: 10px 10px 0 0;
}

.rfq-form .line-items-header h3 {
  margin: 0;
}

.rfq-supplier-picker {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.rfq-supplier-search {
  width: 100%;
  max-width: 480px;
}

.rfq-suppliers-table {
  margin: 0;
  border: none;
}

.rfq-suppliers-table th {
  background: #edf2f7;
}

.rfq-supplier-name {
  font-weight: 600;
  color: var(--color-text-strongest);
}

.rfq-items-table-wrap {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.rfq-form table.data-table.rfq-items-table {
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  margin: 0;
  border: none;
  border-collapse: collapse;
  table-layout: fixed !important;
  background: #fff;
}

.rfq-form table.data-table.rfq-items-table th,
.rfq-form table.data-table.rfq-items-table td {
  overflow: hidden;
  max-width: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.rfq-form table.data-table.rfq-items-table .item-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.rfq-form table.data-table.rfq-items-table .item-picker-input,
.rfq-form table.data-table.rfq-items-table input[type="text"],
.rfq-form table.data-table.rfq-items-table input[type="number"],
.rfq-form table.data-table.rfq-items-table input[type="file"],
.rfq-form table.data-table.rfq-items-table select,
.rfq-form table.data-table.rfq-items-table .bom-file-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

.rfq-items-table thead th {
  background: #edf2f7;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
}

.rfq-items-table tbody td {
  vertical-align: middle;
  background: #fff;
}

.rfq-form table.data-table.rfq-items-table .col-item { width: 20%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-desc { width: 18%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-hsn { width: 10%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-qty { width: 8%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-uom { width: 8%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-warehouse { width: 14%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-attach { width: 14%; min-width: 0 !important; }
.rfq-form table.data-table.rfq-items-table .col-actions { width: 8%; min-width: 0 !important; }

.rfq-form,
.rfq-form .erp-page-card__body--form {
  min-width: 0;
  max-width: 100%;
}

.content:has(.rfq-form-page) {
  min-width: 0;
  overflow-x: hidden;
}

.rfq-form .form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Supplier Quotation form — full-width boxed layout */
.quotation-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.quotation-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  padding: 22px 24px 20px;
  width: 100%;
  box-sizing: border-box;
}

.quotation-box__title {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.quotation-copy-banner {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.quotation-box__section {
  margin-bottom: 18px;
}

.quotation-form .field {
  margin: 0;
}

.quotation-form .field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.quotation-form .required {
  color: #dc2626;
}

.quotation-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

.quotation-form .field input[type="text"],
.quotation-form .field input[type="number"],
.quotation-form .field input[type="date"],
.quotation-form .field select,
.quotation-form .field textarea,
.quotation-form .quotation-supplier-search,
.quotation-form .quotation-gst-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.quotation-form .field textarea {
  min-height: 84px;
  resize: vertical;
}

.quotation-form .field input::placeholder,
.quotation-form .field textarea::placeholder,
.quotation-form .quotation-supplier-search::placeholder {
  color: #94a3b8;
}

.quotation-form .field input:focus,
.quotation-form .field select:focus,
.quotation-form .field textarea:focus,
.quotation-form .quotation-supplier-search:focus,
.quotation-form .quotation-gst-select:focus,
table.data-table.quotation-items-table input:focus {
  outline: none;
  background-color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.quotation-form .sq-percentage-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.quotation-form .sq-percentage-input,
.quotation-form .sq-rate-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.quotation-form .sq-percentage-input.sq-input-invalid,
.quotation-form .sq-rate-input.sq-input-invalid {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15) !important;
}

.quotation-form .sq-percentage-input.sq-input-invalid:focus,
.quotation-form .sq-rate-input.sq-input-invalid:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.quotation-form .sq-field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #64748b;
}

.quotation-form .sq-field-hint[hidden] {
  display: none !important;
}

.quotation-form .sq-field-hint.sq-field-hint--error {
  color: #b91c1c;
  font-weight: 600;
}

.quotation-terms-field {
  margin-top: 14px;
}

.quotation-supplier-picker {
  position: relative;
}

.quotation-items-box {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 0;
}

.quotation-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #d1d5db;
  background: #f8fafc;
}

.quotation-items-head h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a5f;
}

.quotation-gst-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  max-width: none;
}

.quotation-gst-bar label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.quotation-gst-select {
  width: 220px;
  min-width: 180px;
}

.quotation-items-table-wrap {
  overflow-x: auto;
  border-top: none;
  width: 100%;
}

table.data-table.quotation-items-table {
  width: 100%;
  min-width: 1200px;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
}

table.data-table.quotation-items-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 42px;
  padding: 10px 12px;
  background: #edf2f7 !important;
  color: #475569;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
  overflow: visible;
}

table.data-table.quotation-items-table thead th:last-child {
  border-right: none;
}

table.data-table.quotation-items-table tbody td {
  height: 56px;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
  text-overflow: clip;
}

table.data-table.quotation-items-table tbody td:last-child {
  border-right: none;
}

table.data-table.quotation-items-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

table.data-table.quotation-items-table tbody tr:hover td {
  background: #f1f5f9;
}

table.data-table.quotation-items-table th.tax-col-hidden,
table.data-table.quotation-items-table td.tax-col-hidden,
table.data-table.quotation-items-table .tax-col-hidden {
  display: none !important;
}

table.data-table.quotation-items-table .col-item { width: 18%; }
table.data-table.quotation-items-table .col-desc { width: 14%; }
table.data-table.quotation-items-table .col-qty { width: 7%; }
table.data-table.quotation-items-table .col-uom { width: 7%; }
table.data-table.quotation-items-table .col-rate { width: 9%; }
table.data-table.quotation-items-table .col-discount { width: 8%; }
table.data-table.quotation-items-table .col-tax { width: 7%; }
table.data-table.quotation-items-table .col-amount { width: 9%; }
table.data-table.quotation-items-table .col-actions {
  width: 70px;
  text-align: center;
  overflow: visible;
  max-width: none;
}

table.data-table.quotation-items-table input[type="text"],
table.data-table.quotation-items-table input[type="number"],
table.data-table.quotation-items-table .item-picker-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.8125rem;
  color: #111827;
  box-sizing: border-box;
  box-shadow: none;
}

table.data-table.quotation-items-table .col-amount {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

table.data-table.quotation-items-table .col-actions .btn {
  margin: 0;
}

.quotation-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 20px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.quotation-total-row {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  min-width: 220px;
  font-size: 0.875rem;
  color: #64748b;
}

.quotation-total-row strong {
  color: #111827;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.quotation-total-row--grand {
  font-size: 1rem;
  color: #111827;
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
  margin-top: 2px;
}

.quotation-total-row--grand span,
.quotation-total-row--grand strong {
  font-weight: 700;
  color: #0f172a;
}

.quotation-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 4px;
}

.quotation-totals--show {
  padding: 16px 20px 20px;
}

.quotation-terms {
  padding: 8px 20px 20px;
  border-top: 1px solid var(--color-border);
}

.quotation-terms h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-brand-navy);
}

.quotation-terms p {
  margin: 0;
  color: var(--color-text);
  white-space: pre-wrap;
}

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

@media (max-width: 768px) {
  .rfq-form-grid,
  .quotation-form-grid {
    grid-template-columns: 1fr;
  }

  .quotation-box {
    padding: 16px;
    border-radius: 10px;
  }

  .quotation-gst-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .quotation-gst-select {
    width: 100%;
  }
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.pagination-nav .pagy-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-nav .pagy-nav .page a,
.pagination-nav .pagy-nav .page.current,
.pagination-nav .pagy-nav .page.prev a,
.pagination-nav .pagy-nav .page.next a,
.pagination-nav .pagy-nav .page.gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination-nav .pagy-nav .page a:hover {
  background: var(--color-brand-pale);
  border-color: var(--color-brand-light);
  color: var(--color-brand-primary);
}

.pagination-nav .pagy-nav .page.current {
  background: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  color: #fff;
}

.pagination-nav .pagy-nav .page.disabled a,
.pagination-nav .pagy-nav .page.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination-nav .pagy-nav .page.gap {
  border: none;
  background: transparent;
  min-width: auto;
}

/* CSV import progress */
.import-progress-panel,
.import-result-panel {
  padding: 0;
}

.import-progress {
  padding: 28px 24px 32px;
  text-align: center;
}

.import-progress-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid #dbeafe;
  border-top-color: var(--color-brand-primary);
  animation: import-spin 0.8s linear infinite;
}

@keyframes import-spin {
  to { transform: rotate(360deg); }
}

.import-progress-label {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strongest);
}

.import-progress-count {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-brand-primary);
}

.import-progress-track {
  width: 100%;
  max-width: 360px;
  height: 10px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.import-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-brand-primary), var(--color-brand-light));
  transition: width 200ms ease;
}

.import-progress-detail {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.import-result-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-strongest);
}

.import-result-message {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.import-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.import-result-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.import-result-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.import-result-note--error {
  margin-top: 10px;
  color: #b91c1c;
}





/* RFQ show page — full-screen readable detail view */
.rfq-show-page {
  width: 100%;
  max-width: none;
}

.rfq-show-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  padding: 22px 24px 20px;
}

.rfq-show-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.rfq-show-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.rfq-show-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rfq-show-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 40px;
  margin-bottom: 22px;
}

.rfq-show-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}

.rfq-show-meta__col .rfq-show-row:last-child {
  border-bottom: none;
}

.rfq-show-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  padding-top: 2px;
}

.rfq-show-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #111827;
  word-break: break-word;
}

.rfq-show-section {
  margin-top: 8px;
  margin-bottom: 20px;
}

.rfq-show-section__title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

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

.rfq-supplier-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.rfq-supplier-pill:hover {
  background: #bae6fd;
  color: #0c4a6e;
}

.rfq-show-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.875rem;
}

.rfq-show-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

table.rfq-items-grid {
  display: table !important;
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  background: #fff;
}

table.rfq-items-grid thead {
  display: table-header-group !important;
}

table.rfq-items-grid tbody {
  display: table-row-group !important;
}

table.rfq-items-grid tr {
  display: table-row !important;
}

table.rfq-items-grid th,
table.rfq-items-grid td {
  display: table-cell !important;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #111827;
}

table.rfq-items-grid thead th {
  background: #edf2f7;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid #cbd5e1;
}

table.rfq-items-grid tbody tr:nth-child(even) {
  background: #f8fafc;
}

table.rfq-items-grid tbody tr:hover {
  background: #eef6ff;
}

table.rfq-items-grid tbody tr:last-child td {
  border-bottom: none;
}

table.rfq-items-grid .col-item { width: 22%; }
table.rfq-items-grid .col-desc { width: 34%; }
table.rfq-items-grid .col-hsn { width: 14%; }
table.rfq-items-grid .col-qty { width: 8%; text-align: right; }
table.rfq-items-grid .col-uom { width: 8%; }
table.rfq-items-grid .col-attach { width: 14%; }

table.rfq-items-grid td.col-desc {
  white-space: normal;
  word-break: break-word;
  color: #475569;
}

.rfq-item-code {
  font-weight: 700;
  color: #0f172a;
}

.rfq-item-name {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #64748b;
}

.rfq-items-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 14px !important;
}

.rfq-show-page .attachment-file-badge,
.grn-form-page .attachment-file-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.rfq-show-page .attachment-file-badge--pdf,
.grn-form-page .attachment-file-badge--pdf {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.rfq-show-page .attachment-file-badge--pdf:hover,
.grn-form-page .attachment-file-badge--pdf:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.rfq-show-page .attachment-file-badge--image,
.grn-form-page .attachment-file-badge--image {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.rfq-show-page .attachment-file-badge--image:hover,
.grn-form-page .attachment-file-badge--image:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.rfq-show-page .attachment-file-badge--other,
.grn-form-page .attachment-file-badge--other {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.rfq-show-page .attachment-file-badge--other:hover,
.grn-form-page .attachment-file-badge--other:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.rfq-show-page .attachment-file-badge--empty,
.grn-form-page .attachment-file-badge--empty {
  display: inline-block;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  color: #94a3b8;
  font-weight: 500;
}

.rfq-show-page .attachment-file-badge__icon,
.grn-form-page .attachment-file-badge__icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

.rfq-show-page .attachment-file-badge__label,
.grn-form-page .attachment-file-badge__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.grn-form-page .readonly-field--attachment {
  background: transparent;
  border: none;
  padding: 0;
  min-height: 0;
}

.grn-form-page .readonly-field--attachment .attachment-file-badge__label {
  max-width: 280px;
}

table.rfq-items-grid td.col-attach {
  min-width: 140px;
}

.rfq-show-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .rfq-show-meta {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rfq-show-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .rfq-show-card {
    padding: 16px;
  }
}

/* Supplier Quotation listing */
.quotation-list-page {
  width: 100%;
  max-width: none;
}

.quotation-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pending-approval-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}

.pending-approval-badge--empty {
  border-color: #fed7aa;
  color: #ea580c;
  background: #fffbeb;
}

.quotation-list-actions .erp-filter-form {
  margin: 0;
}

.quotation-list-actions .filter-select {
  min-width: 180px;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
}

.quotation-list-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.quotation-list-page table.listing-grid.listing-grid--quotation {
  width: max-content;
  min-width: 2100px;
  table-layout: auto;
}

.quotation-list-page table.listing-grid .col-sq-code,
.quotation-list-page table.listing-grid .col-sq-rfq {
  min-width: 168px;
  white-space: nowrap;
  overflow: visible;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quotation-list-page table.listing-grid .col-sq-vendor {
  min-width: 140px;
  white-space: nowrap;
}

.quotation-list-page table.listing-grid .col-sq-date,
.quotation-list-page table.listing-grid th.col-sq-date {
  min-width: 96px;
  max-width: 112px;
  white-space: nowrap;
}

.quotation-list-page table.listing-grid .col-sq-status,
.quotation-list-page table.listing-grid th.col-sq-status {
  min-width: 150px;
  white-space: nowrap;
  text-align: center;
}

.quotation-list-page table.listing-grid .col-sq-status .badge {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.quotation-list-page table.listing-grid td.num,
.quotation-list-page table.listing-grid th.num {
  min-width: 84px;
  max-width: 124px;
}

.quotation-list-page table.listing-grid .quotation-details-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 180px;
  max-width: 240px;
}

.quotation-list-page table.listing-grid .quotation-remarks {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
  max-width: 180px;
}

.quotation-list-page table.listing-grid .quotation-wrap-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
  max-width: 180px;
}

.quotation-list-page table.listing-grid .sq-approved-cell {
  min-width: 108px;
  max-width: 148px;
  white-space: normal;
  word-break: break-word;
}

.quotation-list-page table.listing-grid td.sq-actions {
  width: 1%;
  min-width: 280px;
  white-space: nowrap;
  vertical-align: middle;
}

.quotation-list-page table.listing-grid td.sq-actions .btn,
.quotation-list-page table.listing-grid td.sq-actions .inline-form,
.quotation-list-page table.listing-grid td.sq-actions form {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 6px 0 0;
}

.quotation-details-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quotation-details-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;
}

.quotation-details-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.quotation-details-list__code {
  font-weight: 700;
  color: #111827;
  font-size: 0.8125rem;
}

.quotation-details-list__desc,
.quotation-details-list__meta {
  color: #6b7280;
  font-size: 0.75rem;
  line-height: 1.35;
}

.quotation-more-items {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Supplier Quotation show page */
.quotation-show-page {
  width: 100%;
  max-width: none;
}

.quotation-show-page .quotation-box__title {
  margin-bottom: 0;
}

.quotation-show-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.quotation-show-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.quotation-show-card__subtitle {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quotation-show-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quotation-show-page .quotation-show-grid .field label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.quotation-show-field {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  word-break: break-word;
}

.quotation-show-field--multiline {
  display: block;
  min-height: 84px;
  align-items: flex-start;
  line-height: 1.45;
  color: #334155;
}

.quotation-show-field--multiline p {
  margin: 0 0 6px;
}

.quotation-show-field--multiline p:last-child {
  margin-bottom: 0;
}

.quotation-show-page .quotation-items-box {
  margin-top: 4px;
}

.quotation-show-page .quotation-items-table-wrap {
  overflow-x: auto;
}

.quotation-show-page table.data-table.quotation-show-items-table {
  width: 100%;
  min-width: 900px;
  margin: 0;
  table-layout: auto;
}

.quotation-show-page table.data-table.quotation-show-items-table thead th {
  position: static;
  background: #edf2f7 !important;
  height: 40px;
  padding: 10px 12px;
}

.quotation-show-page table.data-table.quotation-show-items-table tbody td {
  height: auto;
  padding: 12px;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
  vertical-align: top;
  background: #fff;
}

.quotation-show-section__title {
  margin: 0 0 10px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
}

.quotation-show-history {
  margin-top: 18px;
}

.quotation-show-history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: #111827;
}

.quotation-show-history-row small {
  color: #64748b;
  white-space: nowrap;
}

.quotation-show-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
  .quotation-show-page .quotation-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Purchase Order printable PDF — matches Intello ERP PO format */
.po-print {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  background: #fff;
  padding: 12mm 14mm 10mm;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color: #111;
  position: relative;
  font-family: Arial, Helvetica, sans-serif;
}

.po-print--page1 {
  display: flex;
  flex-direction: column;
}

.po-print--page1 > .po-print__page1-footer {
  margin-top: auto;
  padding-top: 18px;
}

.po-print__header {
  display: grid;
  grid-template-columns: 130px 1fr 210px;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  align-items: start;
}

.po-print__logo {
  display: flex;
  align-items: flex-start;
}

.po-print__logo-img {
  height: 48px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  object-position: left center;
}

.po-print__company {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  padding-top: 8px;
  align-self: center;
}

.po-print__meta h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: right;
  letter-spacing: 0.01em;
}

.po-print__meta-row {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 2px;
  text-align: right;
  line-height: 1.35;
}

.po-print__meta-row span {
  color: #111;
  font-weight: 700;
}

.po-print__meta-row strong {
  font-weight: 600;
  color: #64748b;
}

.po-print__addresses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 14px 0 10px;
  font-size: 0.7rem;
  line-height: 1.4;
}

.po-print__addresses h3 {
  margin: 0 0 6px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 700;
  color: #111;
}

.po-print__party-name {
  font-weight: 700;
  margin-bottom: 2px !important;
}

.po-print__addresses p {
  margin: 0 0 2px;
}

.po-print__gstin,
.po-print__email {
  margin-top: 4px !important;
  font-weight: 700;
}

.po-print__vendor-quote {
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.75rem;
  color: #111827;
}

.po-print__vendor-quote span {
  color: #4b5563;
  margin-right: 4px;
  font-weight: 400;
}

.po-print__vendor-quote strong {
  color: #111827;
  font-weight: 700;
}

.po-print__schedule {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 8px 0;
  border: 0;
  font-size: 0.75rem;
}

.po-print__schedule span {
  color: #4b5563;
  margin-right: 4px;
}

.po-print__items {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.72rem;
  table-layout: fixed;
  flex: none;
  margin: 0;
}

.po-print__items th,
.po-print__items td {
  border: 1px solid #c0c4ca;
  padding: 5px 4px;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  height: auto;
  background: #fff;
  box-sizing: border-box;
}

.po-print__items th {
  background: #f3f4f6;
  text-transform: none;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: normal;
  vertical-align: middle;
  color: #111;
  line-height: 1.25;
  overflow: hidden;
}

.po-print__items tbody tr:last-child td {
  border-bottom: 1px solid #c0c4ca;
}

.po-print__items .col-sr { width: 4%; text-align: center; }
.po-print__items .col-item { width: 26%; }
.po-print__items .col-hsn { width: 10%; }
.po-print__items .col-unit { width: 7%; }
.po-print__items .col-qty { width: 9%; }
.po-print__items .col-price { width: 12%; }
.po-print__items .col-disc { width: 10%; }
.po-print__items .col-tax { width: 8%; }
.po-print__items .col-amt { width: 14%; }

.po-print__items th.num,
.po-print__items td.num {
  text-align: right;
}

.po-print__items td.num {
  white-space: nowrap;
}

.po-print__empty-msg {
  text-align: center;
  color: #6b7280;
  padding: 14px !important;
}

.po-print__item-name {
  font-weight: 700;
  line-height: 1.35;
}

.po-print__item-desc {
  margin-top: 2px;
  color: #111;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: pre-wrap;
}

.po-print__totals-summary {
  margin: 8px 0 0 auto;
  width: 36%;
  border: 0;
}

.po-print__totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 3px 0;
  font-size: 0.75rem;
  border: 0;
  background: transparent;
}

.po-print__totals-row span {
  font-weight: 600;
  color: #111;
}

.po-print__totals-row strong {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.po-print__total-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 28px;
  margin-top: 12px;
  padding: 10px 14px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #f3f4f6;
  font-size: 0.8125rem;
}

.po-print__total-words {
  min-width: 0;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.72rem;
  line-height: 1.4;
  padding-right: 16px;
  border-right: 1px solid #d1d5db;
}

.po-print__total-label {
  display: inline-block;
  margin-right: 10px;
  font-style: normal;
  font-weight: 800;
}

.po-print__total-words em {
  font-style: italic;
  font-weight: 700;
}

.po-print__total-amount {
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.95rem;
  padding-left: 8px;
  text-align: right;
}

.po-print__footer {
  margin-top: 22px;
}

.po-print__page1-footer {
  text-align: center;
}

.po-print__terms {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0 28px;
  align-items: start;
}

.po-print__terms-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.po-print__terms-body {
  margin: 0;
  padding-left: 18px;
  font-size: 0.72rem;
  color: #111;
  line-height: 1.45;
  list-style: decimal;
  list-style-position: outside;
}

.po-print__terms-body li {
  margin: 0 0 4px;
}

.po-print__note {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: #4b5563;
}

.po-print__gtc-note {
  margin: 8px auto 0;
  max-width: 92%;
  text-align: center;
  font-size: 0.62rem;
  line-height: 1.45;
  color: #9ca3af;
}

/* General Terms & Conditions — each sheet is its own A4 page */
.po-tc-sheet.po-print {
  min-height: 0;
  height: 297mm;
  font-family: "Times New Roman", Times, serif;
}

.po-tc-sheet {
  page-break-before: always;
  break-before: page;
  page-break-after: always;
  break-after: page;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  overflow: hidden;
  margin: 0 auto 24px;
  padding: 12mm 14mm 10mm;
  font-family: "Times New Roman", Times, serif;
  color: #525252;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.po-tc-sheet--last {
  page-break-after: auto;
  break-after: auto;
  margin-bottom: 0;
}

.po-tc-sheet__header {
  position: relative;
  flex: 0 0 auto;
  margin-bottom: 18px;
}

.po-tc-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.po-tc-sheet__footer {
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid #c4c4c4;
  text-align: center;
}

.po-tc__continued {
  position: absolute;
  top: 58px;
  right: 0;
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.82rem;
  font-style: italic;
  color: #666;
}

.po-tc__body {
  display: block;
}

.po-tc__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.po-tc__logo {
  height: 52px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.po-tc__company-footer,
.po-tc-sheet__footer {
  font-family: "Times New Roman", Times, serif;
  font-size: 0.72rem;
  line-height: 1.42;
  color: #666;
}

.po-tc-sheet__footer p,
.po-tc__company-footer p {
  margin: 0 0 3px;
}

.po-tc-sheet__footer p:last-child,
.po-tc__company-footer p:last-child {
  margin-bottom: 0;
}

.po-tc__company-name {
  font-weight: 700;
  font-size: 0.74rem;
  color: #666;
}

.po-tc__company-line {
  max-width: 100%;
}

.po-tc__label {
  font-weight: 700;
  color: #737373;
}

.po-tc__title {
  margin: 0;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #404040;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.po-tc__list {
  margin: 0;
  padding: 0 0 0 24px;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.82rem;
  line-height: 1.48;
  text-align: justify;
  color: #525252;
}

.po-tc__list li {
  margin-bottom: 10px;
  padding-left: 2px;
}

.po-tc__list li::marker {
  font-weight: 700;
  color: #454545;
}

.po-tc__list li strong {
  font-weight: 700;
  color: #454545;
}

.po-tc__closing {
  margin: 14px 0 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.82rem;
  line-height: 1.48;
  text-align: justify;
  color: #525252;
}

.po-tc__contact {
  margin-top: 2px !important;
  color: #737373;
  font-size: 0.72rem;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  .po-print {
    box-shadow: none;
    margin: 0 auto;
    width: 210mm;
    min-height: 297mm;
    padding: 12mm 14mm 10mm;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .po-print--page1 {
    page-break-after: always;
    break-after: page;
    min-height: 297mm;
    height: 297mm;
    max-height: 297mm;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .po-tc-sheet {
    width: 210mm;
    height: 297mm;
    max-height: 297mm;
    overflow: hidden;
    box-shadow: none;
    margin: 0 auto;
    padding: 12mm 14mm 10mm;
    page-break-before: always;
    break-before: page;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .po-tc-sheet--last {
    page-break-after: auto;
    break-after: auto;
  }

  .po-tc-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .po-tc-sheet__footer {
    flex: 0 0 auto;
  }

  .print-sheet-wrap {
    margin: 0;
    padding: 0 !important;
  }
}

.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

/* Purchase Order listing */
.po-list-page {
  width: 100%;
  max-width: none;
}

.po-list-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.po-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.po-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.po-filter-input,
.po-filter-date,
.po-list-filters .filter-select {
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
}

.po-filter-input {
  min-width: 180px;
}

.po-filter-date {
  min-width: 150px;
}

.po-list-filters .filter-select {
  min-width: 140px;
}

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

.po-list-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.po-list-page table.listing-grid.listing-grid--po {
  width: max-content;
  min-width: 2620px;
  table-layout: auto;
}

.po-list-page table.listing-grid .col-po-system,
.po-list-page table.listing-grid .col-po-intello {
  min-width: 168px;
  white-space: nowrap;
  overflow: visible;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.po-list-page table.listing-grid .col-po-intello {
  min-width: 176px;
}

.po-list-page table.listing-grid .col-po-status {
  min-width: 172px;
  white-space: nowrap;
  text-align: center;
}

.po-list-page table.listing-grid .col-po-payment {
  min-width: 96px;
  white-space: nowrap;
  text-align: center;
}

.po-list-page table.listing-grid .col-po-pdf {
  min-width: 180px;
  max-width: 240px;
}

.po-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  text-decoration: none;
}

.po-pdf-link__icon {
  display: inline-flex;
  flex-shrink: 0;
  line-height: 0;
}

.po-pdf-link__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.po-pdf-link:hover .po-pdf-link__label {
  text-decoration: underline;
}

.po-list-page table.listing-grid .col-po-status .badge,
.po-list-page table.listing-grid .col-po-payment .badge {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.po-list-page table.listing-grid .col-date,
.po-list-page table.listing-grid th.col-date {
  min-width: 96px;
  max-width: 112px;
  white-space: nowrap;
}

.po-list-page table.listing-grid td.num,
.po-list-page table.listing-grid th.num {
  min-width: 84px;
  max-width: 124px;
}

.po-list-page table.listing-grid th.num:nth-child(10) {
  min-width: 108px;
  max-width: 132px;
}

.po-list-page table.listing-grid .po-wrap-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 132px;
  max-width: 196px;
}

.po-list-page table.listing-grid .po-remarks-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 128px;
  max-width: 188px;
}

.po-list-page table.listing-grid .po-approved-cell {
  min-width: 108px;
  max-width: 148px;
  white-space: normal;
  word-break: break-word;
}

.po-list-page table.listing-grid td.po-actions {
  width: 1%;
  min-width: 620px;
  white-space: nowrap;
  vertical-align: middle;
}

.po-list-page table.listing-grid td.po-actions .btn,
.po-list-page table.listing-grid td.po-actions .inline-form,
.po-list-page table.listing-grid td.po-actions form {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

.grn-list-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.grn-list-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.grn-list-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.grn-list-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.grn-list-page table.listing-grid.listing-grid--grn {
  width: max-content;
  min-width: 1680px;
  table-layout: auto;
}

.grn-list-page table.listing-grid .col-grn-number,
.grn-list-page table.listing-grid .col-grn-po {
  min-width: 196px;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.grn-list-page table.listing-grid .col-grn-intello-po {
  min-width: 188px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.grn-list-page table.listing-grid .col-grn-supplier {
  min-width: 160px;
  max-width: 240px;
  white-space: normal;
  word-break: break-word;
}

.grn-list-page table.listing-grid .col-grn-invoice {
  min-width: 140px;
  white-space: nowrap;
}

.grn-list-page table.listing-grid .col-grn-invoice-pdf {
  min-width: 120px;
  white-space: nowrap;
}

.grn-list-page table.listing-grid .col-date,
.grn-list-page table.listing-grid th.col-date {
  min-width: 108px;
  white-space: nowrap;
}

.grn-list-page table.listing-grid .col-grn-received-qty {
  min-width: 120px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.grn-list-page table.listing-grid .col-grn-total {
  min-width: 112px;
  white-space: nowrap;
}

.grn-list-page table.listing-grid .col-grn-created-by {
  min-width: 140px;
  max-width: 200px;
  white-space: normal;
  word-break: break-word;
}

.grn-list-page table.listing-grid .col-grn-status {
  min-width: 120px;
  white-space: nowrap;
  text-align: center;
}

.grn-list-page table.listing-grid .col-grn-status .badge {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

.grn-list-page table.listing-grid td.col-grn-actions {
  width: 1%;
  min-width: 220px;
  white-space: nowrap;
  vertical-align: middle;
}

.grn-list-page table.listing-grid td.col-grn-actions .btn,
.grn-list-page table.listing-grid td.col-grn-actions .inline-form,
.grn-list-page table.listing-grid td.col-grn-actions form {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

.btn-po-standard {
  background: #fff;
  color: #2563eb;
  border: 1px solid #93c5fd;
}

.btn-po-standard:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.btn-grn {
  background: #1e3a5f;
  color: #fff;
  border: 1px solid #1e3a5f;
}

.btn-grn:hover {
  background: #16304f;
  color: #fff;
}

/* Shared listing grid — full row/column table (Vendor Master style) */
.vendor-list-page {
  width: 100%;
  max-width: none;
}

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

.vendor-list-actions .search-form {
  margin: 0;
}

.vendor-list-actions .search-input {
  min-width: 200px;
  height: 36px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
}

.listing-table-wrap,
.vendor-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid #e2e8f0;
  padding: 20px 20px 8px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.listing-table-wrap::-webkit-scrollbar,
.vendor-table-wrap::-webkit-scrollbar,
.po-list-table-wrap::-webkit-scrollbar,
.quotation-list-table-wrap::-webkit-scrollbar,
.item-master-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.listing-table-wrap::-webkit-scrollbar-thumb,
.vendor-table-wrap::-webkit-scrollbar-thumb,
.po-list-table-wrap::-webkit-scrollbar-thumb,
.quotation-list-table-wrap::-webkit-scrollbar-thumb,
.item-master-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.listing-table-wrap::-webkit-scrollbar-track,
.vendor-table-wrap::-webkit-scrollbar-track,
.po-list-table-wrap::-webkit-scrollbar-track,
.quotation-list-table-wrap::-webkit-scrollbar-track,
.item-master-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

table.listing-grid,
table.vendor-grid {
  display: table !important;
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
  margin: 0;
}

table.listing-grid thead,
table.vendor-grid thead {
  display: table-header-group !important;
}

table.listing-grid tbody,
table.vendor-grid tbody {
  display: table-row-group !important;
}

table.listing-grid tr,
table.vendor-grid tr {
  display: table-row !important;
}

table.listing-grid th,
table.listing-grid td,
table.vendor-grid th,
table.vendor-grid td {
  display: table-cell !important;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #111827;
  background: #fff;
}

table.listing-grid thead th,
table.vendor-grid thead th {
  background: #edf2f7;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

table.listing-grid tbody tr:nth-child(even) td,
table.vendor-grid tbody tr:nth-child(even) td {
  background: #f8fafc;
}

table.listing-grid tbody tr:hover td,
table.vendor-grid tbody tr:hover td {
  background: #eef6ff;
}

table.vendor-grid .col-code {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-left: 18px;
}

table.listing-grid thead th:first-child,
table.listing-grid tbody td:first-child,
table.vendor-grid thead th:first-child,
table.vendor-grid tbody td:first-child {
  padding-left: 18px;
}

table.vendor-grid .col-name {
  min-width: 160px;
  max-width: 240px;
  white-space: normal;
  word-break: break-word;
}

table.vendor-grid .col-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.vendor-grid .col-addresses {
  min-width: 140px;
  white-space: normal;
}

.vendor-address-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.vendor-add-address-btn {
  padding: 2px 8px;
  font-size: 0.7rem;
  line-height: 1.3;
}

table.listing-grid .col-actions,
table.listing-grid td.actions,
table.vendor-grid .col-actions {
  white-space: nowrap;
  width: 1%;
  padding-right: 18px;
}

table.listing-grid thead th:last-child,
table.listing-grid tbody td:last-child,
table.vendor-grid thead th:last-child,
table.vendor-grid tbody td:last-child {
  padding-right: 18px;
}

table.listing-grid .col-actions .btn,
table.listing-grid .col-actions .inline-form,
table.listing-grid td.actions .btn,
table.listing-grid td.actions .inline-form,
table.vendor-grid .col-actions .btn,
table.listing-grid .col-actions .inline-form,
table.listing-grid td.actions .inline-form,
table.vendor-grid .col-actions .inline-form {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 6px;
}

table.vendor-grid .col-actions .inline-form {
  margin: 0 6px 0 0;
  padding: 0;
}

.module-actions {
  vertical-align: middle;
}

.module-actions__row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.module-actions__row .btn,
.module-actions__row .inline-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.module-actions__row .inline-form {
  padding: 0;
}

.currency-indicator {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.approvals-po-actions {
  vertical-align: middle;
  white-space: nowrap;
}

.approvals-po-actions__row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.approvals-po-actions__row .btn {
  margin: 0;
}


table.listing-grid {
  min-width: 960px;
}

table.listing-grid.listing-grid--wide {
  min-width: 1680px;
}

table.listing-grid.listing-grid--po {
  min-width: 2400px;
}

table.listing-grid.listing-grid--quotation {
  min-width: 2100px;
}

table.listing-grid.listing-grid--bom {
  min-width: 1200px;
}

table.listing-grid.listing-grid--items {
  width: max-content;
  min-width: 1960px;
  table-layout: auto;
}

.bom-list-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.bom-list-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.bom-list-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.bom-list-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.bom-list-page table.listing-grid.listing-grid--bom {
  width: 100%;
  min-width: 1200px;
  table-layout: auto;
}

.bom-list-page table.listing-grid .col-bom-number {
  min-width: 148px;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bom-list-page table.listing-grid .col-bom-custom {
  min-width: 168px;
  white-space: nowrap;
}

.bom-list-page table.listing-grid .col-bom-item {
  min-width: 200px;
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
}

.bom-list-page table.listing-grid .col-bom-project,
.bom-list-page table.listing-grid .col-bom-module {
  min-width: 240px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

.bom-list-page table.listing-grid .col-bom-qty {
  min-width: 120px;
  max-width: 140px;
  white-space: nowrap;
}

.bom-list-page table.listing-grid .col-bom-value {
  min-width: 132px;
  max-width: 156px;
  white-space: nowrap;
}

.bom-list-page table.listing-grid .col-bom-status {
  min-width: 108px;
  white-space: nowrap;
  text-align: center;
}

.bom-list-page table.listing-grid .col-bom-modified {
  min-width: 132px;
  white-space: nowrap;
}

.bom-list-page table.listing-grid td.bom-actions {
  width: 1%;
  min-width: 520px;
  white-space: nowrap;
  vertical-align: middle;
}

.bom-list-page table.listing-grid td.bom-actions .btn,
.bom-list-page table.listing-grid td.bom-actions .inline-form,
.bom-list-page table.listing-grid td.bom-actions form {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 6px 0 0;
}

.item-master-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.item-master-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.item-master-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.item-master-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.item-master-list-page table.listing-grid .col-code {
  min-width: 120px;
}

.item-master-list-page table.listing-grid .col-item-name {
  min-width: 300px;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-master-list-page table.listing-grid .col-item-description {
  min-width: 280px;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-master-list-page table.listing-grid .col-item-category {
  min-width: 120px;
  white-space: nowrap;
}

.item-master-list-page table.listing-grid .col-item-unit,
.item-master-list-page table.listing-grid .col-item-rack {
  min-width: 88px;
  white-space: nowrap;
}

.item-master-list-page table.listing-grid .col-item-hsn {
  min-width: 96px;
  white-space: nowrap;
}

.item-master-list-page table.listing-grid .col-item-rate,
.item-master-list-page table.listing-grid .col-item-tax,
.item-master-list-page table.listing-grid .col-item-stock {
  min-width: 96px;
}

.item-master-list-page table.listing-grid .col-item-type,
.item-master-list-page table.listing-grid .col-item-status {
  min-width: 132px;
  white-space: nowrap;
}

.item-master-list-page table.listing-grid .col-actions {
  min-width: 132px;
  white-space: nowrap;
}

table.listing-grid .col-code,
table.listing-grid td.col-code {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.listing-grid td.num,
table.listing-grid th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.listing-grid .text-muted,
table.listing-grid .table-subtext {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1.3;
}

table.listing-grid a.table-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

table.listing-grid a.table-link:hover {
  text-decoration: underline;
}

.vendor-address-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.vendor-address-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.vendor-address-badge--billing {
  background: #ecfdf5;
  border-color: #86efac;
  color: #15803d;
}

.vendor-address-badge--shipping {
  background: #fff;
  border-color: #cbd5e1;
  color: #475569;
}

.vendor-address-badge--office,
.vendor-address-badge--other {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.vendor-address-master {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.vendor-address-master__hint,
.vendor-address-master__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.vendor-address-master__empty {
  color: #94a3b8;
}

.vendor-address-master__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-address-master-field .vendor-address-badges {
  margin-bottom: 2px;
}

table.listing-grid td.empty,
.vendor-empty {
  text-align: center !important;
  color: #94a3b8;
  padding: 28px 12px !important;
}


/* ========== CEO Dashboard ========== */
.ceo-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ceo-section__header,
.ceo-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ceo-section__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1d4ed8;
}

.ceo-section__subtitle,
.ceo-panel__subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.ceo-section__meta {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

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

.ceo-kpi-grid .kpi-card {
  min-height: 108px;
}

.ceo-kpi-grid .kpi-value {
  margin-bottom: 2px;
}

.ceo-kpi-link,
.dashboard-kpi-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ceo-kpi-link:focus-visible,
.dashboard-kpi-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ceo-kpi-link:hover,
.dashboard-kpi-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.ceo-panels {
  display: grid;
  gap: 14px;
}

.ceo-panels--2 {
  grid-template-columns: 1fr 1.4fr;
}

.ceo-panels--1 {
  grid-template-columns: minmax(0, 1fr);
}

.ceo-panels--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ceo-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.ceo-panel--table {
  padding-bottom: 8px;
}

.ceo-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.ceo-empty {
  padding: 36px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

.ceo-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: #64748b;
}

.ceo-bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ceo-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.ceo-swatch--budget { background: #93c5fd; }
.ceo-swatch--po { background: #2563eb; }
.ceo-swatch--paid { background: #16a34a; }

.ceo-compare-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ceo-compare-filter-form {
  flex-shrink: 0;
}

.ceo-compare-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}

.ceo-compare-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  flex-shrink: 0;
}

.ceo-compare-filter__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 1px;
}

.ceo-compare-filter__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.ceo-compare-filter__select {
  min-width: 200px;
  max-width: 280px;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 0.875rem;
}

.ceo-sort-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.ceo-sort-link:hover {
  color: #1d4ed8;
}

.ceo-sort-link:hover .ceo-sort-arrow--neutral {
  color: #64748b;
}

.ceo-sort-link.is-active {
  color: #1d4ed8;
  font-weight: 600;
}

.ceo-sort-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.75rem;
  font-size: 0.65rem;
  line-height: 1;
}

.ceo-sort-arrow--neutral {
  color: #94a3b8;
}

.ceo-sort-arrow--active {
  color: #1d4ed8;
  font-weight: 700;
}

.ceo-compare-row {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ceo-compare-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.1);
}

.ceo-compare-row.is-over-budget {
  background: #fff1f2;
  border-color: #fecdd3;
}

.ceo-compare-row.is-over-budget:hover {
  border-color: #fb7185;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.1);
}

.ceo-compare-row__link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}

.ceo-compare-row__link:hover .ceo-compare-row__title {
  color: #1d4ed8;
}

.ceo-compare-row__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ceo-compare-row__identity {
  min-width: 0;
  flex: 1;
}

.ceo-compare-row__code {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ceo-compare-row__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-top: 4px;
  word-break: break-word;
}

.ceo-compare-row__sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

.ceo-compare-row__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  min-width: 0;
}

.ceo-compare-row__amount {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.ceo-metric-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ceo-metric-bar__label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: #64748b;
}

.ceo-metric-bar__label strong {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.ceo-metric-bar__track {
  position: relative;
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.ceo-metric-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 0;
}

.ceo-metric-bar__fill--budget { background: #93c5fd; }
.ceo-metric-bar__fill--po { background: #2563eb; }
.ceo-metric-bar__fill--po.is-over { background: #e11d48; }
.ceo-metric-bar__fill--paid { background: #16a34a; }

.ceo-metric-bar__empty {
  display: block;
  padding: 0 8px;
  font-size: 0.6875rem;
  line-height: 10px;
  color: #94a3b8;
}

.ceo-compare-row__meta {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.ceo-danger-text {
  color: #be123c;
  font-weight: 600;
}

.ceo-status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ceo-status-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr auto;
  gap: 10px;
  align-items: center;
}

.ceo-status-row__label {
  font-size: 0.8125rem;
  color: #334155;
  font-weight: 500;
}

.ceo-status-row__count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 28px;
  text-align: right;
}

.ceo-status-track {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.ceo-status-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.ceo-status-fill.tone-blue { background: #3b82f6; }
.ceo-status-fill.tone-purple { background: #8b5cf6; }
.ceo-status-fill.tone-orange { background: #f59e0b; }
.ceo-status-fill.tone-green { background: #22c55e; }

.ceo-health-table th.num,
.ceo-health-table td.num {
  text-align: right;
  white-space: nowrap;
}

.ceo-project-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}

.ceo-project-cell strong {
  font-size: 0.8125rem;
  color: #0f172a;
}

.ceo-project-cell__sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.ceo-health-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ceo-health-badge--risk {
  background: #ffe4e6;
  color: #be123c;
}

.ceo-health-badge--watch {
  background: #ffedd5;
  color: #c2410c;
}

.ceo-health-badge--ok {
  background: #dcfce7;
  color: #15803d;
}

.ceo-progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.ceo-progress-cell .progress-bar {
  flex: 1;
  min-width: 60px;
}

.ceo-progress-cell span {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 28px;
}

@media (max-width: 1200px) {
  .ceo-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ceo-panels--2,
  .ceo-panels--3 {
    grid-template-columns: 1fr;
  }

  .ceo-compare-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .ceo-panel__header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ceo-compare-filter-form {
    width: 100%;
  }

  .ceo-compare-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .ceo-compare-filter,
  .ceo-compare-filter--projects {
    min-width: 0;
    max-width: none;
    width: 100%;
    flex: 0 0 auto;
  }

  .ceo-compare-filter__select {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .ceo-compare-filter--projects .project-multi-picker,
  .ceo-compare-filter--projects .project-multi-picker__field {
    min-width: 0;
    width: 100%;
  }

  .ceo-compare-filter--projects .project-multi-picker__input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .ceo-compare-filter__actions {
    width: 100%;
    padding-bottom: 0;
  }
}

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

  .ceo-status-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ceo-section__header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .ceo-section__meta {
    white-space: normal;
  }

  .ceo-compare-filter__actions {
    flex-wrap: wrap;
  }

  .ceo-compare-filter__actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .ceo-bar-legend {
    gap: 10px;
  }
}

/* Payments index — wide transactional table */
.payments-index-wrap {
  overflow-x: auto;
}

.payments-index-table {
  min-width: 1400px;
}

.payments-index-table th,
.payments-index-table td {
  white-space: nowrap;
  font-size: 0.8125rem;
  vertical-align: middle;
}

.payments-index-table td.actions {
  white-space: nowrap;
}

/* ===== Inventory page ===== */
.inventory-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inventory-kpi-grid {
  margin-bottom: 16px;
}

.inventory-kpi {
  position: relative;
  overflow: hidden;
  border-left-width: 4px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(26, 54, 93, 0.06);
  border: 1px solid var(--color-border);
  border-left-width: 4px;
}

.inventory-kpi .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.inventory-kpi .kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-strongest);
  line-height: 1.15;
}

.inventory-kpi .kpi-sub {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.inventory-kpi--items {
  background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
  border-left-color: var(--color-brand-navy);
}

.inventory-kpi--items .kpi-value { color: var(--color-brand-navy); }

.inventory-kpi--available {
  background: linear-gradient(180deg, var(--color-success-bg) 0%, #fff 100%);
  border-left-color: var(--color-success);
}

.inventory-kpi--available .kpi-value { color: var(--color-success-strong); }

.inventory-kpi--out {
  background: linear-gradient(180deg, var(--color-danger-bg) 0%, #fff 100%);
  border-left-color: var(--color-danger);
}

.inventory-kpi--out .kpi-value { color: var(--color-danger-strong); }

.inventory-kpi--qty {
  background: linear-gradient(180deg, var(--color-info-bg) 0%, #fff 100%);
  border-left-color: var(--color-teal);
}

.inventory-kpi--qty .kpi-value { color: var(--color-teal); }

.inventory-card {
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 3px rgba(26, 54, 93, 0.06);
}

.inventory-card__header {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom-color: var(--color-border);
}

.inventory-card__header .erp-page-card__title {
  color: var(--color-brand-navy);
  font-weight: 700;
}

.inventory-card__header .projects-summary-subtitle {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.inventory-manage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.inventory-manage-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 180px;
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.inventory-manage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.inventory-manage-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f8fafc;
  color: #1d4ed8;
}

.inventory-manage-card__icon svg {
  width: 26px;
  height: 26px;
}

.inventory-manage-card__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.inventory-manage-card__desc {
  margin: 0;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.inventory-manage-card--in { border-left: 5px solid #16a34a; }
.inventory-manage-card--in .inventory-manage-card__icon { background: #ecfdf5; color: #15803d; }

.inventory-manage-card--out { border-left: 5px solid #dc2626; }
.inventory-manage-card--out .inventory-manage-card__icon { background: #fef2f2; color: #b91c1c; }

.inventory-manage-card--return { border-left: 5px solid #d97706; }
.inventory-manage-card--return .inventory-manage-card__icon { background: #fff7ed; color: #c2410c; }

.inventory-manage-card--returnable { border-left: 5px solid #7c3aed; }
.inventory-manage-card--returnable .inventory-manage-card__icon { background: #f5f3ff; color: #6d28d9; }

.inventory-manage-card--transfer { border-left: 5px solid #2563eb; }
.inventory-manage-card--transfer .inventory-manage-card__icon { background: #eff6ff; color: #1d4ed8; }

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

.inventory-filter-bar {
  margin: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--color-brand-pale) 0%, #f7fafc 100%);
  border-bottom: 1px solid var(--color-info-border);
}

.inventory-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.inventory-search-field {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
}

.inventory-search-field__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--color-brand-primary);
  display: inline-flex;
  pointer-events: none;
}

.inventory-search-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text-strongest);
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.inventory-search-input::placeholder {
  color: var(--color-text-subtle);
}

.inventory-search-input:hover {
  border-color: var(--color-brand-light);
}

.inventory-search-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.inventory-status-select {
  min-width: 168px;
  min-height: 38px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  background-color: #fff;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
}

.inventory-status-select:hover,
.inventory-status-select:focus {
  border-color: var(--color-brand-primary);
  color: var(--color-info-strong);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.inventory-search-btn {
  min-height: 38px;
  padding-left: 16px;
  padding-right: 16px;
  font-weight: 600;
}

.inventory-table {
  min-width: 920px;
}

.inventory-table thead th {
  background: var(--color-brand-navy) !important;
  color: #e2e8f0 !important;
  border-color: #234e7a !important;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.inventory-table tbody td {
  font-size: 0.84rem;
  color: var(--color-text);
  border-color: var(--color-border-light);
}

.inventory-table tbody tr:nth-child(even) td {
  background: var(--color-surface-alternate);
}

.inventory-table tbody tr:hover td {
  background: var(--color-surface-selected) !important;
}

.inventory-table td.col-code {
  color: var(--color-brand-navy);
  font-weight: 700;
  font-size: 0.8125rem;
}

.inventory-table a.table-link {
  color: var(--color-brand-primary);
}

.inventory-table a.table-link:hover {
  color: var(--color-brand-primary-hover);
}

.inventory-qty strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.inventory-qty--positive strong {
  color: var(--color-success-strong);
}

.inventory-qty--zero strong {
  color: var(--color-text-muted);
}

.inventory-action-out {
  border-color: #fbd38d;
  background: var(--color-warning-bg);
  color: var(--color-warning-strong);
}

.inventory-action-out:hover {
  background: #feebc8;
  border-color: var(--color-warning);
  color: var(--color-warning-strong);
}

.inventory-action-return {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success-strong);
}

.inventory-action-return:hover {
  background: #c6f6d5;
  border-color: var(--color-success);
  color: var(--color-success-strong);
}

.inventory-table--movements {
  min-width: 980px;
}

.inventory-movements-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inventory-movements-table {
  min-width: 2400px;
  table-layout: auto;
}

.inventory-movements-table th,
.inventory-movements-table td {
  vertical-align: top;
  line-height: 1.45;
}

.inventory-movements-table .col-date {
  min-width: 96px;
  white-space: nowrap;
}

.inventory-movements-table .col-type {
  min-width: 112px;
  white-space: nowrap;
}

.inventory-movements-table .col-item {
  min-width: 280px;
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-transfer-project {
  min-width: 200px;
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-machine {
  min-width: 160px;
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-module {
  min-width: 200px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-reference {
  min-width: 140px;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-movement-user {
  min-width: 150px;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-remarks {
  min-width: 260px;
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}

.inventory-movements-table .col-qty,
.inventory-movements-table .col-rate,
.inventory-movements-table .col-balance {
  min-width: 88px;
  white-space: nowrap;
}

.inventory-movements-table .col-return-condition {
  min-width: 120px;
  white-space: nowrap;
}

.inventory-movements-table .col-returnable,
.inventory-movements-table .col-expected-return,
.inventory-movements-table .col-return-status {
  min-width: 110px;
  white-space: nowrap;
}

.inventory-movements-table tr.inventory-movement-row--overdue {
  background: #fef2f2;
}

.inventory-movements-table tr.inventory-movement-row--overdue td {
  border-top-color: #fecaca;
}

.inventory-movements-table tr.inventory-movement-row--overdue:hover {
  background: #fee2e2;
}

.inventory-movements-table .col-actions {
  min-width: 72px;
  white-space: nowrap;
}

.inventory-movements-table .col-item .table-link {
  font-weight: 600;
}

/* Inventory Requests index — wide table with horizontal scroll */
.content:has(.inventory-requests-index-page) {
  padding-left: 12px;
  padding-right: 12px;
  max-width: none;
}

.inventory-requests-index-page {
  width: 100%;
  max-width: none;
}

.inventory-requests-index-page.erp-page-card {
  overflow: visible;
}

.inventory-requests-index-page .inventory-requests-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border-top: none;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.inventory-requests-index-page .inventory-requests-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.inventory-requests-index-page .inventory-requests-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.inventory-requests-index-page .inventory-requests-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.inventory-requests-index-page table.listing-grid.inventory-requests-table {
  width: max-content;
  min-width: 1580px;
  table-layout: auto;
}

.inventory-requests-index-page table.listing-grid .col-code {
  min-width: 172px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-type {
  min-width: 112px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-status {
  min-width: 136px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-project {
  min-width: 220px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.inventory-requests-index-page table.listing-grid .col-user,
.inventory-requests-index-page table.listing-grid .col-requested-by {
  min-width: 128px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-items {
  min-width: 68px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-returnable {
  min-width: 148px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-returned {
  min-width: 92px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid .col-date {
  min-width: 108px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid td.col-actions,
.inventory-requests-index-page table.listing-grid th.col-actions {
  min-width: 260px;
  white-space: nowrap;
}

.inventory-requests-index-page table.listing-grid td.col-actions .btn {
  margin-right: 6px;
}

.inventory-requests-index-page table.listing-grid td.col-actions .btn:last-child {
  margin-right: 0;
}

.transfer-requests-index-page .transfer-requests-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border-top: none;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.transfer-requests-index-page .transfer-requests-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.transfer-requests-index-page .transfer-requests-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.transfer-requests-index-page .transfer-requests-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.transfer-requests-index-page table.listing-grid.transfer-requests-table {
  width: max-content;
  min-width: 1480px;
  table-layout: fixed;
}

.transfer-requests-index-page table.listing-grid .col-code {
  width: 168px;
  min-width: 168px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid .col-status {
  width: 132px;
  min-width: 132px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid .col-from,
.transfer-requests-index-page table.listing-grid .col-to {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  vertical-align: top;
}

.transfer-requests-index-page table.listing-grid .col-user {
  width: 128px;
  min-width: 128px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid .col-items {
  width: 64px;
  min-width: 64px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid .col-date {
  width: 108px;
  min-width: 108px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid td.col-actions,
.transfer-requests-index-page table.listing-grid th.col-actions {
  width: 220px;
  min-width: 220px;
  white-space: nowrap;
}

.transfer-requests-index-page table.listing-grid td.col-actions .btn {
  margin-right: 6px;
}

.transfer-requests-index-page table.listing-grid td.col-actions .btn:last-child {
  margin-right: 0;
}

.returnable-items-overdue-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
}

.returnable-items-overdue-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.returnable-items-overdue-banner__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.returnable-items-overdue-banner__action {
  margin-left: auto;
  white-space: nowrap;
}

.returnable-items-table tr.returnable-item-row--overdue {
  background: #fef2f2;
}

.returnable-items-table tr.returnable-item-row--overdue td {
  border-top-color: #fecaca;
}

.returnable-items-table tr.returnable-item-row--overdue:hover {
  background: #fee2e2;
}

.returnable-item-date--overdue {
  color: #b91c1c;
  font-weight: 700;
}

.returnable-item-overdue-hint {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.returnable-item-row-flag {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
}

.returnable-item-user-overdue-tag {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.returnable-item-badge--overdue {
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

@media (max-width: 900px) {
  .inventory-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-search-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .inventory-status-select,
  .inventory-search-btn {
    width: 100%;
  }
}

/* ===== Shared index list theme (Inventory-style, reusable) ===== */
.index-list-page {
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 3px rgba(26, 54, 93, 0.06);
}

.index-list-card__header {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom-color: var(--color-border);
}

.index-list-card__header .erp-page-card__title {
  color: var(--color-brand-navy);
  font-weight: 700;
}

.index-list-card__header .projects-summary-subtitle {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.index-filter-bar {
  margin: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--color-brand-pale) 0%, #f7fafc 100%);
  border-bottom: 1px solid var(--color-info-border);
}

.index-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.cash-outflow-windows-by-month-modal__dialog {
  width: min(720px, calc(100vw - 32px));
}

.cash-outflow-windows-by-month-modal__subtitle {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.cash-outflow-create-by-month-form__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cash-outflow-create-by-month-form__year .field {
  margin: 0;
  max-width: 180px;
}

.cash-outflow-create-by-month-form__error {
  margin: 0;
}

.cash-outflow-create-by-month-form__note {
  margin: 0;
}

.cash-outflow-month-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.cash-outflow-month-picker legend {
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.cash-outflow-month-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.cash-outflow-month-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cash-outflow-month-picker__option:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
}

.cash-outflow-week-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.index-search-field {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
}

.index-search-field__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--color-brand-primary);
  display: inline-flex;
  pointer-events: none;
}

.index-search-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text-strongest);
  font-size: 0.875rem;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.index-search-input::placeholder {
  color: var(--color-text-subtle);
}

.project-filter-field .project-picker {
  width: 100%;
}

.project-filter-field .project-picker-input,
.index-search-field .item-picker-input,
.supplier-filter-field .item-picker-input {
  padding-left: 38px;
  background-color: #fff;
  border-color: var(--color-info-border);
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
}

.project-filter-field .project-picker-input:focus,
.index-search-field .item-picker-input:focus,
.supplier-filter-field .item-picker-input:focus {
  background-color: #fff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.project-filter-field .project-picker-input {
  width: 100%;
}

.project-picker.item-picker {
  position: relative;
  width: 100%;
}

.project-picker-input {
  width: 100%;
}

.bom-form-grid .project-picker,
.form-grid .project-picker,
.rfq-form-grid .project-picker,
.quotation-form-grid .project-picker {
  width: 100%;
}

.ceo-compare-filter--projects {
  min-width: 280px;
  flex: 1 1 320px;
  max-width: 420px;
}

.project-multi-picker {
  display: block;
  width: 100%;
}

.project-multi-picker__field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: text;
}

.project-multi-picker__field:focus-within {
  border-color: var(--color-brand-primary, #2563eb);
  box-shadow: 0 0 0 3px var(--color-focus-ring, rgba(37, 99, 235, 0.15));
}

.ceo-compare-filter--projects .project-multi-picker__field {
  min-width: 200px;
}

.project-multi-picker__chips {
  display: contents;
}

.project-multi-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-multi-picker__chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-multi-picker__chip-remove {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.project-multi-picker__chip-remove:hover {
  color: #1d4ed8;
}

.project-multi-picker__input {
  flex: 1 1 120px;
  min-width: 120px;
  width: auto;
  border: 0;
  outline: none;
  padding: 4px 2px;
  background: transparent;
  font-size: 0.875rem;
  line-height: 1.4;
}

.item-picker-option.is-selected {
  background: #eff6ff;
}

.item-picker-selected-mark {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
}

.ceo-compare-filter .project-picker {
  min-width: 220px;
}

.ceo-compare-filter .project-picker-input {
  width: 100%;
  min-height: 36px;
}

.index-search-input:hover {
  border-color: var(--color-brand-light);
}

.index-search-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.index-status-select {
  min-width: 168px;
  min-height: 38px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  background-color: #fff;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
}

.index-status-select:hover,
.index-status-select:focus {
  border-color: var(--color-brand-primary);
  color: var(--color-info-strong);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.index-search-btn {
  min-height: 38px;
  padding-left: 16px;
  padding-right: 16px;
  font-weight: 600;
}

table.index-table thead th,
.index-table thead th {
  background: var(--color-brand-navy) !important;
  color: #e2e8f0 !important;
  border-color: #234e7a !important;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

table.index-table tbody td,
.index-table tbody td {
  font-size: 0.84rem;
  color: var(--color-text);
  border-color: var(--color-border-light);
}

table.index-table tbody tr:nth-child(even) td,
.index-table tbody tr:nth-child(even) td {
  background: var(--color-surface-alternate);
}

table.index-table tbody tr:hover td,
.index-table tbody tr:hover td {
  background: var(--color-surface-selected) !important;
}

table.index-table td.col-code,
.index-table td.col-code {
  color: var(--color-brand-navy);
  font-weight: 700;
  font-size: 0.8125rem;
}

table.index-table a.table-link,
.index-table a.table-link {
  color: var(--color-brand-primary);
  font-weight: 600;
}

table.index-table a.table-link:hover,
.index-table a.table-link:hover {
  color: var(--color-brand-primary-hover);
  text-decoration: underline;
}

.index-action-view {
  border-color: var(--color-info-border);
  background: var(--color-info-bg);
  color: var(--color-info-strong);
}

.index-action-view:hover {
  background: #bee3f8;
  border-color: var(--color-brand-light);
  color: var(--color-brand-navy);
}

.index-action-edit {
  border: 1px solid #c3dafe;
  background: #ebf4ff;
  color: var(--color-brand-navy);
}

.index-action-edit:hover {
  background: #c3dafe;
  border-color: var(--color-brand-light);
  color: var(--color-brand-navy);
}

.index-action-address {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success-strong);
}

.index-action-address:hover {
  background: #c6f6d5;
  border-color: var(--color-success);
  color: var(--color-success-strong);
}

.index-action-notify {
  background: #fff;
  border: 1px solid #6366f1;
  color: #4338ca;
}

.index-action-notify:hover {
  background: #eef2ff;
  border-color: #4338ca;
  color: #312e81;
}

.returnable-items-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.returnable-items-actions .inline-form {
  display: inline-flex;
  margin: 0;
}

.index-action-delete {
  border: 1px solid var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger-strong);
}

.index-action-delete:hover {
  background: #fed7d7;
  border-color: var(--color-danger);
  color: var(--color-danger-strong);
}

/* Toolbar buttons (Export / Template / Upload / primary) */
.index-btn-export {
  border: 1px solid var(--color-info-border);
  background: var(--color-info-bg);
  color: var(--color-info-strong);
  font-weight: 600;
}

.index-btn-export:hover {
  background: #bee3f8;
  border-color: var(--color-brand-light);
  color: var(--color-brand-navy);
}

.index-btn-template {
  border: 1px solid #c3dafe;
  background: #fff;
  color: var(--color-brand-navy);
  font-weight: 600;
}

.index-btn-template:hover {
  background: var(--color-brand-pale);
  border-color: var(--color-brand-light);
  color: var(--color-brand-primary);
}

.index-btn-upload {
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning-strong);
  font-weight: 600;
}

.index-btn-upload:hover {
  background: #feebc8;
  border-color: var(--color-warning);
  color: var(--color-warning-strong);
}

.index-btn-primary {
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.25);
}

.index-btn-primary:hover {
  box-shadow: 0 2px 6px rgba(43, 108, 176, 0.3);
}

.vendor-list-page .vendor-list-actions .btn,
.vendor-list-page .col-actions .btn,
.index-list-page .toolbar-actions .btn,
.index-list-page .col-actions .btn,
.index-list-page td.actions .btn {
  border-radius: 7px;
  min-height: 32px;
  padding: 5px 11px;
}

.vendor-list-page .col-actions .btn,
.index-list-page .col-actions .btn,
.index-list-page td.actions .btn {
  font-weight: 600;
}

.vendor-list-page.index-list-page .vendor-table-wrap {
  border-top: none;
}

@media (max-width: 900px) {
  .index-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .index-search-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .index-status-select,
  .index-search-btn {
    width: 100%;
  }
}

/* Index page auto-theming */
.index-list-page table.listing-grid thead th,
.index-list-page table.vendor-grid thead th {
  background: var(--color-brand-navy) !important;
  color: #e2e8f0 !important;
  border-color: #234e7a !important;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.index-list-page table.listing-grid tbody td,
.index-list-page table.vendor-grid tbody td {
  font-size: 0.84rem;
  color: var(--color-text);
  border-color: var(--color-border-light);
}

.index-list-page table.listing-grid tbody tr:nth-child(even) td,
.index-list-page table.vendor-grid tbody tr:nth-child(even) td {
  background: var(--color-surface-alternate);
}

.index-list-page table.listing-grid tbody tr:hover td,
.index-list-page table.vendor-grid tbody tr:hover td {
  background: var(--color-surface-selected) !important;
}

.index-list-page table.listing-grid td.col-code,
.index-list-page table.vendor-grid .col-code {
  color: var(--color-brand-navy);
  font-weight: 700;
}

.index-list-page table.listing-grid a.table-link,
.index-list-page table.vendor-grid a.table-link {
  color: var(--color-brand-primary);
  font-weight: 600;
}

.index-list-page .listing-table-wrap,
.index-list-page .vendor-table-wrap {
  border-top: none;
}

.index-list-page .toolbar-actions .btn,
.index-list-page .index-filter-bar .btn,
.index-list-page td.actions .btn,
.index-list-page td.col-actions .btn,
.index-list-page .sq-actions .btn,
.index-list-page .po-actions .btn {
  border-radius: 7px;
  min-height: 32px;
  font-weight: 600;
}

.index-list-page .index-filter-bar select,
.index-list-page .index-filter-form select,
.index-list-page .index-filter-form input[type="date"] {
  min-width: 168px;
  min-height: 38px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  background-color: #fff;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.06);
}

.index-list-page .index-filter-form input[type="date"] {
  padding: 8px 12px;
}

.index-list-page .index-filter-bar select:hover,
.index-list-page .index-filter-bar select:focus,
.index-list-page .index-filter-form select:hover,
.index-list-page .index-filter-form select:focus,
.index-list-page .index-filter-form input[type="date"]:hover,
.index-list-page .index-filter-form input[type="date"]:focus {
  border-color: var(--color-brand-primary);
  color: var(--color-info-strong);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.index-list-page td.actions .btn-outline,
.index-list-page td.col-actions .btn-outline,
.index-list-page .sq-actions .btn-outline,
.index-list-page .po-actions .btn-outline:not(.btn-po-standard):not(.btn-grn) {
  border-color: var(--color-info-border);
  background: var(--color-info-bg);
  color: var(--color-info-strong);
}

.index-list-page td.actions .btn-outline:hover,
.index-list-page td.col-actions .btn-outline:hover,
.index-list-page .sq-actions .btn-outline:hover,
.index-list-page .po-actions .btn-outline:hover:not(.btn-po-standard):not(.btn-grn) {
  background: #bee3f8;
  border-color: var(--color-brand-light);
  color: var(--color-brand-navy);
}

.index-list-page td.actions .btn-edit,
.index-list-page td.col-actions .btn-edit,
.index-list-page .sq-actions .btn-edit,
.index-list-page .po-actions .btn-edit {
  border: 1px solid #c3dafe;
  background: #ebf4ff;
  color: var(--color-brand-navy);
}

.index-list-page td.actions .btn-edit:hover,
.index-list-page td.col-actions .btn-edit:hover,
.index-list-page .sq-actions .btn-edit:hover,
.index-list-page .po-actions .btn-edit:hover {
  background: #c3dafe;
  border-color: var(--color-brand-light);
}

.index-list-page td.actions .btn-danger,
.index-list-page td.col-actions .btn-danger,
.index-list-page .sq-actions .btn-danger,
.index-list-page .po-actions .btn-danger {
  border: 1px solid var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger-strong);
}

.index-list-page td.actions .btn-danger:hover,
.index-list-page td.col-actions .btn-danger:hover,
.index-list-page .sq-actions .btn-danger:hover,
.index-list-page .po-actions .btn-danger:hover {
  background: #fed7d7;
  border-color: var(--color-danger);
}

.index-list-page td.actions .btn-success,
.index-list-page .col-actions .btn-success,
.index-list-page .sq-actions .btn-success,
.index-list-page .po-actions .btn-success {
  border: 1px solid var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success-strong);
}

.index-list-page td.actions .btn-success:hover,
.index-list-page .col-actions .btn-success:hover,
.index-list-page .sq-actions .btn-success:hover,
.index-list-page .po-actions .btn-success:hover {
  background: #c6f6d5;
  border-color: var(--color-success);
}

.index-btn-secondary {
  border: 1px solid #c3dafe;
  background: #fff;
  color: var(--color-brand-navy);
  font-weight: 600;
}

.index-btn-secondary:hover {
  background: var(--color-brand-pale);
  border-color: var(--color-brand-light);
  color: var(--color-brand-primary);
}

.index-kpi-grid {
  margin-bottom: 16px;
}

.index-kpi-grid .kpi-card {
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(26, 54, 93, 0.06);
}

.index-kpi-grid .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.index-kpi-grid .kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-text-strongest);
}

.index-kpi-grid .kpi-sub {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.index-kpi-grid .kpi-card.blue {
  background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
  border-left-color: var(--color-brand-navy);
}

.index-kpi-grid .kpi-card.blue .kpi-value { color: var(--color-brand-navy); }

.index-kpi-grid .kpi-card.green {
  background: linear-gradient(180deg, var(--color-success-bg) 0%, #fff 100%);
  border-left-color: var(--color-success);
}

.index-kpi-grid .kpi-card.green .kpi-value { color: var(--color-success-strong); }

.index-kpi-grid .kpi-card.red,
.index-kpi-grid .kpi-card.pink {
  background: linear-gradient(180deg, var(--color-danger-bg) 0%, #fff 100%);
  border-left-color: var(--color-danger);
}

.index-kpi-grid .kpi-card.red .kpi-value,
.index-kpi-grid .kpi-card.pink .kpi-value { color: var(--color-danger-strong); }

.index-kpi-grid .kpi-card.orange {
  background: linear-gradient(180deg, var(--color-warning-bg) 0%, #fff 100%);
  border-left-color: var(--color-warning);
}

.index-kpi-grid .kpi-card.orange .kpi-value { color: var(--color-warning-strong); }

.index-kpi-grid .kpi-card.purple {
  background: linear-gradient(180deg, var(--color-purple-bg) 0%, #fff 100%);
  border-left-color: var(--color-purple);
}

.index-kpi-grid .kpi-card.purple .kpi-value { color: var(--color-purple-strong); }

.index-kpi-grid .kpi-card.teal {
  background: linear-gradient(180deg, var(--color-info-bg) 0%, #fff 100%);
  border-left-color: var(--color-teal);
}

.index-kpi-grid .kpi-card.teal .kpi-value { color: var(--color-teal); }

/* ===== Create / Edit form page theme (matches index list styling) ===== */
.erp-page-card:has(.erp-page-card__body--form),
.erp-page-card.rfq-form-page,
.erp-page-card.po-form-page,
.erp-page-card.grn-form-page,
.form-card,
.bom-page .bom-box,
.quotation-page .quotation-box,
.payment-form-card {
  border-color: var(--color-border-strong);
  box-shadow: 0 1px 3px rgba(26, 54, 93, 0.06);
}

.payment-form-card .paid-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-form-card .paid-amount-row input[type="number"] {
  flex: 1;
  min-width: 0;
}

.payment-form-card .paid-amount-row__extra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.erp-page-card:has(.erp-page-card__body--form) > .erp-page-card__header,
.erp-page-card.rfq-form-page > .erp-page-card__header,
.erp-page-card.po-form-page > .erp-page-card__header,
.erp-page-card.grn-form-page > .erp-page-card__header {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom-color: var(--color-border);
}

.erp-page-card.grn-form-page .erp-page-card__header {
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom-color: var(--color-border);
}

.erp-page-card:has(.erp-page-card__body--form) > .erp-page-card__header .erp-page-card__title,
.erp-page-card.rfq-form-page > .erp-page-card__header .erp-page-card__title,
.erp-page-card.po-form-page > .erp-page-card__header .erp-page-card__title,
.erp-page-card.grn-form-page > .erp-page-card__header .erp-page-card__title {
  color: var(--color-brand-navy);
  font-weight: 700;
}

.erp-page-card.grn-form-page .erp-page-card__header .erp-page-card__title {
  color: var(--color-brand-navy);
  font-weight: 700;
}

.form-card > h2,
.bom-page .bom-box__title,
.quotation-page .quotation-box__title {
  color: var(--color-brand-navy);
  font-weight: 700;
  margin-top: 0;
}

.erp-page-card:has(.erp-page-card__body--form) .form-actions,
.form-card .form-actions,
.bom-form .form-actions,
.bom-form .bom-form-actions,
.po-form .form-actions,
.grn-form .form-actions,
.rfq-form .form-actions,
.quotation-form .quotation-form-actions,
.item-form .form-actions,
.address-form .form-actions,
.payment-form-card .form-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-info-border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Primary submit — Create / Update / Save */
.erp-page-card:has(.erp-page-card__body--form) .form-actions .btn-primary,
.erp-page-card:has(.erp-page-card__body--form) .form-actions input.btn-primary,
.erp-page-card:has(.erp-page-card__body--form) .form-actions button.btn-primary,
.erp-page-card.rfq-form-page .form-actions .btn-primary,
.erp-page-card.po-form-page .form-actions .btn-primary,
.erp-page-card.grn-form-page .form-actions .btn-primary,
.form-card .form-actions .btn-primary,
.form-card input.btn-primary[type="submit"],
.form-card button.btn-primary,
.bom-form .bom-form-actions .btn-primary,
.bom-form .bom-form-actions button.btn-primary,
.bom-form .bom-components-head__actions .btn-primary,
.bom-form .bom-components-head__actions button.btn-primary,
.po-form .form-actions .btn-primary,
.grn-form .form-actions .btn-primary,
.rfq-form .form-actions .btn-primary,
.quotation-form .quotation-form-actions .btn-primary,
.item-form .form-actions .btn-primary,
.address-form .form-actions .btn-primary,
.payment-form-card .form-actions .btn-primary {
  font-weight: 600;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.25);
}

.erp-page-card:has(.erp-page-card__body--form) .form-actions .btn-primary:hover,
.form-card .form-actions .btn-primary:hover,
.bom-form .bom-form-actions .btn-primary:hover,
.bom-form .bom-components-head__actions .btn-primary:hover,
.po-form .form-actions .btn-primary:hover,
.grn-form .form-actions .btn-primary:hover,
.rfq-form .form-actions .btn-primary:hover,
.quotation-form .quotation-form-actions .btn-primary:hover,
.item-form .form-actions .btn-primary:hover,
.address-form .form-actions .btn-primary:hover,
.payment-form-card .form-actions .btn-primary:hover {
  box-shadow: 0 2px 6px rgba(43, 108, 176, 0.3);
}

/* Cancel / Back — secondary */
.erp-page-card:has(.erp-page-card__body--form) > .erp-page-card__header .btn-outline,
.erp-page-card.rfq-form-page > .erp-page-card__header .btn-outline,
.erp-page-card.po-form-page > .erp-page-card__header .btn-outline,
.erp-page-card.grn-form-page > .erp-page-card__header .btn-outline,
.index-form-page > .erp-page-card__header .btn-outline,
.bom-page .bom-box__header .btn-outline,
.erp-page-card:has(.erp-page-card__body--form) .form-actions .btn-outline,
.form-card .form-actions .btn-outline,
.form-card a.btn-outline,
.bom-form .bom-form-actions .btn-outline,
.po-form .form-actions .btn-outline,
.grn-form .form-actions .btn-outline,
.rfq-form .form-actions .btn-outline,
.quotation-form .quotation-form-actions .btn-outline,
.item-form .form-actions .btn-outline,
.address-form .form-actions .btn-outline,
.payment-form-card .form-actions .btn-outline {
  border: 1px solid #c3dafe;
  background: #fff;
  color: var(--color-brand-navy);
  font-weight: 600;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 7px;
}

.erp-page-card:has(.erp-page-card__body--form) > .erp-page-card__header .btn-outline:hover,
.index-form-page > .erp-page-card__header .btn-outline:hover,
.bom-page .bom-box__header .btn-outline:hover,
.erp-page-card:has(.erp-page-card__body--form) .form-actions .btn-outline:hover,
.form-card .form-actions .btn-outline:hover,
.form-card a.btn-outline:hover,
.bom-form .bom-form-actions .btn-outline:hover,
.po-form .form-actions .btn-outline:hover,
.grn-form .form-actions .btn-outline:hover,
.rfq-form .form-actions .btn-outline:hover,
.quotation-form .quotation-form-actions .btn-outline:hover,
.item-form .form-actions .btn-outline:hover,
.address-form .form-actions .btn-outline:hover,
.payment-form-card .form-actions .btn-outline:hover {
  background: var(--color-brand-pale);
  border-color: var(--color-brand-light);
  color: var(--color-brand-primary);
}

/* Save Draft — soft amber in multi-action forms */
.bom-form .bom-form-actions button.btn-outline[name="bom_action"],
.quotation-form .quotation-form-actions button.btn-outline[name="quotation_action"],
.po-form .form-actions button.btn-outline[name="po_action"],
.grn-form .form-actions button.btn-outline[name="grn_action"],
.rfq-form .form-actions button.btn-outline[name="rfq_action"],
.payment-form-card .form-actions button.btn-outline[name="payment_action"] {
  border: 1px solid var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning-strong);
}

.bom-form .bom-form-actions button.btn-outline[name="bom_action"]:hover,
.quotation-form .quotation-form-actions button.btn-outline[name="quotation_action"]:hover,
.po-form .form-actions button.btn-outline[name="po_action"]:hover,
.grn-form .form-actions button.btn-outline[name="grn_action"]:hover,
.rfq-form .form-actions button.btn-outline[name="rfq_action"]:hover,
.payment-form-card .form-actions button.btn-outline[name="payment_action"]:hover {
  background: #feebc8;
  border-color: var(--color-warning);
  color: var(--color-warning-strong);
}

/* Legacy inline form footers (project modules, customers, etc.) */
.form-card form > div:last-child .btn-primary,
.form-card form > div[style*="margin-top"] .btn-primary {
  font-weight: 600;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(43, 108, 176, 0.25);
}

.form-card form > div:last-child .btn-outline,
.form-card form > div[style*="margin-top"] .btn-outline {
  border: 1px solid #c3dafe;
  background: #fff;
  color: var(--color-brand-navy);
  font-weight: 600;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 7px;
}

.form-card form > div:last-child .btn-outline:hover,
.form-card form > div[style*="margin-top"] .btn-outline:hover {
  background: var(--color-brand-pale);
  border-color: var(--color-brand-light);
  color: var(--color-brand-primary);
}

/* Item show page — full-width detail layout */
.item-show-page .bom-show-field--multiline {
  min-height: 72px;
  align-items: flex-start;
  white-space: pre-wrap;
  line-height: 1.45;
}

.item-show-page .bom-show-card__subtitle .badge {
  vertical-align: middle;
}

.item-show-page .item-inventory-box {
  margin-top: 4px;
}

.item-show-page .item-inventory-table-wrap {
  border-top: 1px solid #d1d5db;
}

.item-show-page table.data-table.item-inventory-table {
  display: table !important;
  width: 100% !important;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.item-show-page table.data-table.item-inventory-table th,
.item-show-page table.data-table.item-inventory-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #eef2f7;
  vertical-align: middle;
}

.item-show-page table.data-table.item-inventory-table th:last-child,
.item-show-page table.data-table.item-inventory-table td:last-child {
  border-right: none;
}

.item-show-page table.data-table.item-inventory-table thead th {
  background: #edf2f7;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.item-show-page table.data-table.item-inventory-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.item-show-page table.data-table.item-inventory-table tbody tr:hover td {
  background: #eff6ff;
}

.item-show-page table.data-table.item-inventory-table tfoot td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  border-bottom: none;
  color: #0f172a;
  font-weight: 600;
}

.item-show-page table.data-table.item-inventory-table .col-scope {
  width: 55%;
  white-space: normal;
}

.item-show-page table.data-table.item-inventory-table .col-qty {
  width: 25%;
}

.item-show-page table.data-table.item-inventory-table .col-uom {
  width: 20%;
  color: #64748b;
}

.item-show-page .item-inventory-scope--general {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.8125rem;
  font-weight: 600;
}

.machine-splits-modal__dialog {
  width: min(96vw, 1280px);
  max-height: min(92vh, 860px);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.machine-splits-modal__body {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(92vh - 140px);
  padding-top: 8px;
  min-width: 0;
}

.machine-splits-scroll-hint {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.machine-item-splits-wrap {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  max-width: 100%;
  scrollbar-gutter: stable;
  padding-bottom: 2px;
}

.machine-item-splits-table {
  margin: 0;
  min-width: 1280px;
  width: max-content;
}

.machine-item-splits-table thead th {
  font-size: 0.6875rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: #edf2f7;
  z-index: 1;
}

.machine-item-splits-table td,
.machine-item-splits-table th {
  vertical-align: middle;
  white-space: nowrap;
}

.machine-item-splits-table .col-source {
  min-width: 88px;
}

.machine-item-splits-table tfoot td {
  background: var(--color-surface-subtle);
  border-top: 2px solid var(--color-border);
}

.machine-splits-qty-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: normal;
  padding-top: 10px;
  padding-bottom: 10px;
}

.machine-items-table .machine-item-row td {
  vertical-align: middle;
}

.machine-items-table tfoot td {
  background: var(--color-surface-subtle);
  border-top: 2px solid var(--color-border);
}

.bom-show-page table.data-table.machine-items-table {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: auto !important;
}

.bom-show-page table.data-table.machine-items-table th,
.bom-show-page table.data-table.machine-items-table td {
  overflow: visible;
  max-width: none;
  white-space: normal;
}

.bom-show-page table.data-table.machine-items-table .col-module {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-show-page table.data-table.machine-items-table .col-qty,
.bom-show-page table.data-table.machine-items-table .col-rate,
.bom-show-page table.data-table.machine-items-table .col-amount {
  white-space: nowrap;
}

.bom-show-page table.data-table.machine-items-table .col-splits {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
  text-align: right;
  padding-right: 4px;
}

.bom-show-page table.data-table.machine-items-table .col-splits .btn {
  white-space: nowrap;
}

