/* Vendor & Procurement Management — theme/tokens.css only */

.vpm-main {
  padding: 24px;
  max-width: min(1600px, 100%);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.vpm-breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: rgb(var(--muted));
  font-size: var(--font-helper);
  margin-bottom: 16px;
}

.vpm-breadcrumb a {
  color: rgb(var(--primary));
  text-decoration: none;
}

.vpm-breadcrumb a:hover {
  text-decoration: underline;
}

.vpm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.vpm-header h1 {
  margin: 0;
}

.vpm-header .subtitle {
  color: rgb(var(--muted));
  margin-top: 6px;
  max-width: 640px;
}

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

.vpm-demo-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid rgb(var(--border));
  border-radius: 8px;
  background: rgb(var(--hover) / 0.45);
  color: rgb(var(--muted));
  font-size: var(--font-helper);
}

.vpm-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.vpm-stat {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.vpm-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--primary) / 0.08);
  color: rgb(var(--primary));
  flex-shrink: 0;
}

.vpm-stat-icon.warn {
  background: rgb(var(--warning) / 0.12);
  color: rgb(var(--warning));
}

.vpm-stat-icon.ok {
  background: rgb(var(--success) / 0.12);
  color: rgb(var(--success));
}

.vpm-stat-icon.err {
  background: rgb(var(--error) / 0.12);
  color: rgb(var(--error));
}

.vpm-stat p {
  margin: 0;
}

.vpm-stat .helper {
  margin-bottom: 2px;
}

.vpm-stat-value {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.2;
}

.vpm-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.vpm-panel {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  overflow: visible;
}

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

.vpm-panel-head h2 {
  margin: 0;
  font-size: 1rem;
}

.vpm-panel-body {
  padding: 12px 16px 16px;
}

.vpm-toolbar-wrap {
  position: relative;
  overflow: visible;
  z-index: 6;
}

.vpm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgb(var(--border));
  overflow: visible;
}

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

.vpm-toolbar .field {
  min-width: 160px;
  flex: 1 1 160px;
}

.vpm-toolbar .search-field {
  flex: 0 0 200px;
  width: 200px;
  min-width: 160px;
  max-width: 260px;
  margin: 0;
}

.vpm-toolbar .btn.btn-active,
.vpm-toolbar .btn.btn-primary {
  background: rgb(var(--primary) / 0.08);
  border-color: rgb(var(--primary) / 0.35);
  color: rgb(var(--primary));
}

.vpm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  flex: 0 1 auto;
  min-width: 0;
}

.vpm-filter-bar[hidden] {
  display: none !important;
}

.vpm-filter-field {
  display: block;
  flex: 0 0 150px;
  width: 150px;
  min-width: 130px;
  max-width: 180px;
  margin: 0;
}

.vpm-filter-field admin-select {
  width: 100%;
  min-width: 0;
}

.vpm-filter-field admin-select > button.input {
  justify-content: space-between;
  gap: 10px;
  padding-right: 10px;
}

.btn-text {
  border: 0;
  background: transparent;
  color: rgb(var(--primary));
  padding: 6px 4px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-text:hover { text-decoration: underline; }
.clear-all-filters { color: rgb(var(--muted)); white-space: nowrap; }
.clear-all-filters:hover { color: rgb(var(--text)); }

.adv-filter-anchor { position: relative; }
.adv-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 40;
  width: min(560px, calc(100vw - 16px));
  max-width: min(560px, calc(100vw - 16px));
  box-sizing: border-box;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 28px rgb(var(--overlay) / .14);
}
.adv-filter-rows { display: flex; flex-direction: column; gap: 10px; }
.adv-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) 36px;
  gap: 8px;
  align-items: center;
}
.adv-filter-field, .adv-filter-op, .adv-filter-value-wrap { min-width: 0; }
.adv-filter-value-wrap .field { margin: 0; }
.adv-filter-value-wrap .input { width: 100%; min-height: 40px; }
.adv-filter-remove { color: rgb(var(--muted)); justify-self: center; }
.adv-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgb(var(--border));
  flex-wrap: wrap;
}
.adv-filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

@media (max-width: 768px) {
  .adv-filter-panel { left: 0; right: auto; width: min(560px, calc(100vw - 16px)); max-width: min(560px, calc(100vw - 16px)); }
  .adv-filter-row { grid-template-columns: 1fr; }
  .adv-filter-remove { justify-self: end; }
  .adv-filter-actions { margin-left: 0; width: 100%; }
  .adv-filter-actions .btn { flex: 1; }
}

.vpm-table-wrap {
  position: relative;
  z-index: 1;
  overflow: auto;
  max-width: 100%;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.vpm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-body);
  table-layout: auto;
}

.vpm-table th,
.vpm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgb(var(--border));
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  background: rgb(var(--surface));
}

.vpm-table th {
  background: rgb(var(--hover));
  color: rgb(var(--muted));
  font-weight: 550;
  font-size: var(--font-helper);
  position: sticky;
  top: 0;
  z-index: 1;
}

.vpm-table tbody tr.vpm-row-click {
  cursor: pointer;
}

.vpm-table tbody tr:hover td {
  background: rgb(var(--hover) / 0.55);
}

.vpm-table.sticky-select .col-check {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

.vpm-table.sticky-select .col-action {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.vpm-table.sticky-select thead .col-check,
.vpm-table.sticky-select thead .col-action {
  z-index: 3;
  background: rgb(var(--hover));
}

.vpm-table.sticky-select tbody tr:hover .col-check,
.vpm-table.sticky-select tbody tr:hover .col-action {
  background: rgb(var(--hover) / 0.55);
}

.vpm-table.vendors-table td:nth-child(2),
.vpm-table.vendors-table th:nth-child(2) {
  min-width: 200px;
  white-space: normal;
}

.vpm-table.vendors-table td:nth-child(3) {
  min-width: 140px;
  white-space: normal;
}

.vpm-primary-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vpm-primary-cell strong {
  display: block;
  font-weight: 600;
  line-height: 1.25;
}

.vpm-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgb(var(--primary) / 0.08);
  color: rgb(var(--primary));
  flex-shrink: 0;
}

.vpm-cell-sub {
  display: block;
  color: rgb(var(--muted));
  font-size: var(--font-helper);
  margin-top: 2px;
}

.vpm-bulk-wrap {
  position: relative;
}

.vpm-bulk-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 200px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 6px 20px rgb(var(--overlay) / 0.12);
}

.vpm-bulk-menu .option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: var(--font-body);
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.vpm-bulk-menu .option:hover,
.vpm-bulk-menu .option:focus-visible {
  background: rgb(var(--hover));
}

.vpm-bulk-menu .option.danger,
.vpm-bulk-menu [data-action="bulk-remove"],
.vpm-bulk-menu [data-action="bulk-remove-all"] {
  color: rgb(var(--error));
}

.vpm-bulk-menu .option:disabled,
.vpm-bulk-menu .option[disabled],
.vpm-bulk-menu .option.danger:disabled,
.vpm-bulk-menu [data-action="bulk-remove"]:disabled {
  color: rgb(var(--muted));
  opacity: .5;
  cursor: not-allowed;
  background: transparent;
}

.vpm-bulk-menu .option:disabled:hover,
.vpm-bulk-menu .option[disabled]:hover {
  background: transparent;
  color: rgb(var(--muted));
}

.vpm-bulk-menu .sep {
  height: 1px;
  margin: 4px 0;
  background: rgb(var(--border));
}

#table-float-menu.vpm-bulk-menu {
  position: fixed;
}

.vpm-empty {
  text-align: center;
  padding: 36px 16px !important;
  white-space: normal !important;
  color: rgb(var(--muted));
}

.vpm-empty strong {
  display: block;
  color: rgb(var(--text));
  margin-bottom: 4px;
}

.vpm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid rgb(var(--border));
}

.vpm-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vpm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--font-helper);
  font-weight: 550;
  background: rgb(var(--hover));
  color: rgb(var(--muted));
}

.vpm-badge.active,
.vpm-badge.approved,
.vpm-badge.paid,
.vpm-badge.completed,
.vpm-badge.acknowledged,
.vpm-badge.fullyreceived,
.vpm-badge.fullyordered {
  background: rgb(var(--success) / 0.12);
  color: rgb(var(--success));
}

.vpm-badge.pending,
.vpm-badge.pendingapproval,
.vpm-badge.verificationpending,
.vpm-badge.submitted,
.vpm-badge.draft,
.vpm-badge.scheduled,
.vpm-badge.partiallypaid,
.vpm-badge.partiallyreceived,
.vpm-badge.partial,
.vpm-badge.underprocurement,
.vpm-badge.partiallyordered,
.vpm-badge.senttovendor,
.vpm-badge.received {
  background: rgb(var(--warning) / 0.14);
  color: rgb(var(--warning));
}

.vpm-badge.rejected,
.vpm-badge.suspended,
.vpm-badge.cancelled,
.vpm-badge.failed,
.vpm-badge.overdue,
.vpm-badge.inactive {
  background: rgb(var(--error) / 0.12);
  color: rgb(var(--error));
}

.vpm-badge.info,
.vpm-badge.sent,
.vpm-badge.closed {
  background: rgb(var(--info) / 0.12);
  color: rgb(var(--info));
}

.vpm-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgb(var(--border));
  margin-bottom: 16px;
}

.vpm-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font: inherit;
  color: rgb(var(--muted));
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.vpm-tab[aria-selected="true"] {
  color: rgb(var(--primary));
  border-bottom-color: rgb(var(--primary));
  font-weight: 600;
}

.vpm-more {
  position: relative;
  display: inline-flex;
}

.vpm-more-btn {
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  color: rgb(var(--muted));
}

.vpm-more-btn:hover,
.vpm-more-btn:focus-visible {
  background: rgb(var(--hover));
  color: rgb(var(--text));
}

.vpm-more-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 200px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(var(--overlay) / 0.12);
  padding: 6px;
  z-index: 20;
}

.vpm-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  color: rgb(var(--text));
}

.vpm-more-menu button:hover,
.vpm-more-menu button:focus-visible {
  background: rgb(var(--hover));
}

.vpm-more-menu button.danger {
  color: rgb(var(--error));
}

.vpm-more-menu .sep {
  height: 1px;
  background: rgb(var(--border));
  margin: 4px 0;
}

#table-float-menu.vpm-more-menu {
  position: fixed;
}

.vpm-dialog {
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  padding: 0;
  max-width: min(720px, calc(100vw - 32px));
  width: 100%;
  background: rgb(var(--surface));
  color: rgb(var(--text));
}

.vpm-dialog.wide {
  width: min(960px, calc(100vw - 32px));
  max-width: min(960px, calc(100vw - 32px));
}

.vpm-dialog::backdrop {
  background: rgb(var(--overlay) / 0.45);
}

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

.vpm-dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.vpm-dialog-body {
  padding: 16px 18px;
  max-height: min(70vh, 640px);
  overflow: auto;
}

.vpm-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgb(var(--border));
}

.vpm-import-head {
  align-items: flex-start;
}

.vpm-import-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.vpm-import-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgb(var(--primary) / 0.12);
  color: rgb(var(--primary));
  flex-shrink: 0;
}

.vpm-import-title-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.vpm-import-sub {
  margin: 4px 0 0;
}

.vpm-import-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vpm-import-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--font-helper);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--muted));
}

.vpm-import-accent {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: rgb(var(--primary));
  flex-shrink: 0;
}

.vpm-import-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  background: rgb(var(--hover));
}

.vpm-import-template-copy {
  min-width: 0;
}

.vpm-import-template-copy strong {
  display: block;
  font-size: var(--font-body);
  font-weight: 650;
  color: rgb(var(--text));
}

.vpm-import-template-copy .helper {
  margin: 4px 0 0;
}

.vpm-import-template-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.vpm-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  padding: 24px 16px;
  border: 1.5px dashed rgb(var(--primary) / 0.45);
  border-radius: 12px;
  background: rgb(var(--primary) / 0.03);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vpm-import-dropzone:hover,
.vpm-import-dropzone:focus-visible,
.vpm-import-dropzone.is-dragover {
  border-color: rgb(var(--primary));
  background: rgb(var(--primary) / 0.08);
  outline: none;
}

.vpm-import-dropzone.has-file {
  border-style: solid;
  border-color: rgb(var(--primary) / 0.55);
}

.vpm-import-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
}

.vpm-import-drop-icon .ui-icon {
  width: 20px;
  height: 20px;
}

.vpm-import-drop-title {
  font-size: var(--font-body);
  font-weight: 600;
  color: rgb(var(--text));
}

.vpm-import-file-name {
  margin-top: 4px;
  color: rgb(var(--primary));
  font-weight: 550;
}

@media (max-width: 640px) {
  .vpm-import-template {
    flex-direction: column;
    align-items: stretch;
  }

  .vpm-import-template-btn {
    width: 100%;
    justify-content: center;
  }
}

.vpm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.vpm-dialog .vpm-form-grid,
.vpm-dialog .create-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px 16px;
  align-items: start;
}

.vpm-dialog .vpm-form-grid > .full,
.vpm-dialog .create-grid > .full {
  grid-column: 1 / -1 !important;
  min-width: 0;
  max-width: 100%;
}

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

.vpm-form-grid .field {
  min-width: 0;
}

.vpm-form-grid .field .input,
.vpm-form-grid .field admin-select,
.vpm-form-grid .field admin-date-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.vpm-form-grid .field admin-select > button.input,
.vpm-form-grid .field admin-date-picker > button.input,
.create-grid admin-select > button.input,
.create-grid admin-date-picker > button.input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.vpm-form-grid .field admin-select > button.input > span,
.vpm-form-grid .field .date-trigger-label,
.create-grid admin-select > button.input > span,
.create-grid .date-trigger-label {
  min-width: 0;
  flex: 1 1 auto;
}

.vpm-form-grid .field .select-chevron,
.create-grid .select-chevron {
  flex: 0 0 auto;
  margin-left: auto;
}

.vpm-form-grid .field textarea.input {
  min-height: 72px;
  resize: vertical;
}

.vpm-section-title {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgb(var(--border));
  font-size: 0.78rem;
  font-weight: 650;
  color: rgb(var(--muted));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vpm-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.vpm-line-items {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-helper);
}

.vpm-line-items th,
.vpm-line-items td {
  border: 1px solid rgb(var(--border));
  padding: 6px 8px;
}

.vpm-line-items input.input {
  min-height: 32px;
  padding: 4px 8px;
  font-size: var(--font-helper);
}

.vpm-dialog .vpm-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.vpm-dialog .vpm-line-items {
  width: max-content;
  min-width: 44rem;
}

.vpm-dialog .vpm-line-items input.input {
  box-sizing: border-box;
  width: 5.5rem;
  min-width: 5.5rem;
}

.vpm-dialog .vpm-line-items td:first-child input.input {
  width: 10rem;
  min-width: 10rem;
}

.vpm-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(var(--overlay) / 0.35);
  z-index: 40;
}

.vpm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: rgb(var(--surface));
  border-left: 1px solid rgb(var(--border));
  z-index: 41;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgb(var(--overlay) / 0.08);
}

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

.vpm-drawer-body {
  padding: 16px 18px;
  overflow: auto;
  flex: 1;
}

.vpm-drawer-section {
  margin-bottom: 18px;
}

.vpm-drawer-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.vpm-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: var(--font-helper);
}

.vpm-dl dt {
  color: rgb(var(--muted));
}

.vpm-dl dd {
  margin: 0;
}

.vpm-workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
}

.vpm-workflow-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--surface));
  font-size: var(--font-helper);
}

.vpm-workflow-step.current {
  border-color: rgb(var(--primary));
  background: rgb(var(--primary) / 0.08);
  color: rgb(var(--primary));
  font-weight: 600;
}

.vpm-workflow-step.done {
  background: rgb(var(--success) / 0.1);
  color: rgb(var(--success));
}

.vpm-workflow-arrow {
  color: rgb(var(--muted));
}

.vpm-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vpm-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: var(--font-helper);
}

.vpm-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgb(var(--hover));
  overflow: hidden;
}

.vpm-bar-fill {
  height: 100%;
  background: rgb(var(--primary));
  border-radius: 999px;
}

.vpm-list-mini {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vpm-list-mini li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgb(var(--border));
  font-size: var(--font-helper);
}

.vpm-list-mini li:last-child {
  border-bottom: 0;
}

.vpm-compare {
  overflow: auto;
}

.vpm-compare table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-helper);
}

.vpm-compare th,
.vpm-compare td {
  border: 1px solid rgb(var(--border));
  padding: 8px 10px;
  text-align: left;
  background: rgb(var(--surface));
}

.vpm-compare th {
  background: rgb(var(--hover));
}

.vpm-compare .winner {
  background: rgb(var(--success) / 0.1);
  font-weight: 600;
}

.vpm-mismatch {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgb(var(--warning) / 0.45);
  background: rgb(var(--warning) / 0.1);
  color: rgb(var(--text));
  font-size: var(--font-helper);
  margin-bottom: 12px;
}

.vpm-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.vpm-doc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgb(var(--border));
  font-size: var(--font-helper);
}

.vpm-profile-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.vpm-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(var(--primary) / 0.1);
  color: rgb(var(--primary));
  font-weight: 700;
  font-size: 1.1rem;
}

.vpm-future-hint {
  font-size: var(--font-helper);
  color: rgb(var(--muted));
  padding: 8px 10px;
  border-left: 3px solid rgb(var(--border));
  margin: 8px 0 0;
}

.ui-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.vpm-stat-icon .ui-icon {
  width: 18px;
  height: 18px;
}

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

@media (max-width: 768px) {
  .vpm-main {
    padding: 16px;
  }

  .vpm-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vpm-summary .vpm-stat-wide {
    grid-column: 1 / -1;
  }

  .vpm-grid-2 {
    grid-template-columns: 1fr;
  }

  .vpm-stat {
    min-width: 0;
    padding: 12px;
    gap: 8px;
  }

  .vpm-stat > div {
    min-width: 0;
  }

  .vpm-stat .helper,
  .vpm-stat-value {
    overflow-wrap: anywhere;
  }

  .vpm-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .vpm-dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .vpm-dialog,
  .vpm-dialog.wide {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }

  .vpm-dialog-body {
    overflow-x: hidden;
  }

  .vpm-dialog .vpm-form-grid,
  .vpm-dialog .create-grid,
  .vpm-form-grid,
  .create-grid {
    grid-template-columns: 1fr !important;
  }
}

body[data-page="add-quotation"] .shared-create-form,
body[data-page="add-quotation"] .shared-create-form form,
body[data-page="add-quotation"] .create-page-body,
body[data-page="add-quotation"] .vpm-form-grid,
body[data-page="add-quotation"] .vpm-form-grid > *,
body[data-page="create-purchase-order"] .shared-create-form,
body[data-page="create-purchase-order"] .shared-create-form form,
body[data-page="create-purchase-order"] .create-page-body,
body[data-page="create-purchase-order"] .vpm-form-grid,
body[data-page="create-purchase-order"] .vpm-form-grid > * {
  min-width: 0;
  max-width: 100%;
}

body[data-page="add-quotation"] .vpm-form-grid .field .input,
body[data-page="add-quotation"] .vpm-form-grid .field admin-select,
body[data-page="add-quotation"] .vpm-form-grid .field admin-date-picker,
body[data-page="add-quotation"] .vpm-form-grid admin-select > button.input,
body[data-page="add-quotation"] .vpm-form-grid admin-date-picker > button.input,
body[data-page="quotations"] .vpm-form-grid .field .input,
body[data-page="quotations"] .vpm-form-grid .field admin-select,
body[data-page="quotations"] .vpm-form-grid .field admin-date-picker,
body[data-page="quotations"] .vpm-form-grid admin-select > button.input,
body[data-page="quotations"] .vpm-form-grid admin-date-picker > button.input,
body[data-page="create-purchase-order"] .vpm-form-grid .field .input,
body[data-page="create-purchase-order"] .vpm-form-grid .field admin-select,
body[data-page="create-purchase-order"] .vpm-form-grid .field admin-date-picker,
body[data-page="create-purchase-order"] .vpm-form-grid admin-select > button.input,
body[data-page="create-purchase-order"] .vpm-form-grid admin-date-picker > button.input,
body[data-page="purchase-orders"] .vpm-form-grid .field .input,
body[data-page="purchase-orders"] .vpm-form-grid .field admin-select,
body[data-page="purchase-orders"] .vpm-form-grid .field admin-date-picker,
body[data-page="purchase-orders"] .vpm-form-grid admin-select > button.input,
body[data-page="purchase-orders"] .vpm-form-grid admin-date-picker > button.input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  body[data-page="add-quotation"] .req-main,
  body[data-page="add-quotation"] .create-page-body,
  body[data-page="create-purchase-order"] .req-main,
  body[data-page="create-purchase-order"] .create-page-body {
    padding: 12px;
  }

  body[data-page="add-quotation"] .shared-create-form .vpm-form-grid,
  body[data-page="create-purchase-order"] .shared-create-form .vpm-form-grid,
  body[data-page="quotations"] .vpm-dialog .vpm-form-grid,
  body[data-page="quotations"] .vpm-dialog .create-grid,
  body[data-page="purchase-orders"] .vpm-dialog .vpm-form-grid,
  body[data-page="purchase-orders"] .vpm-dialog .create-grid {
    grid-template-columns: 1fr !important;
  }
}

.vpm-table-wrap:has(.vpm-line-items[data-kind="qt"]),
.vpm-table-wrap:has(.vpm-line-items[data-kind="po"]) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.vpm-line-items[data-kind="qt"],
.vpm-line-items[data-kind="po"] {
  width: max-content;
  min-width: 44rem;
}

.vpm-line-items[data-kind="qt"] input.input,
.vpm-line-items[data-kind="po"] input.input {
  box-sizing: border-box;
  width: 5.5rem;
  min-width: 5.5rem;
}

.vpm-line-items[data-kind="qt"] td:first-child input.input,
.vpm-line-items[data-kind="po"] td:first-child input.input {
  width: 10rem;
  min-width: 10rem;
}
