/* Standardized ERP Components */

/* 1. Buttons */
.erp-btn {
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}

.erp-btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.erp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

.erp-btn-secondary {
  background: #fff;
  color: var(--secondary-color);
  border: 1px solid #ddd;
}

.erp-btn-secondary:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.erp-btn-success {
  background: linear-gradient(135deg, var(--success-color), #218838);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.erp-btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #b91c1c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.erp-btn-small {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* 2. Cards */
.erp-card {
  background: var(--card-bg);
  backdrop-filter: var(--blur-main);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-main);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.erp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* 3. Page Headers (Base Class) */
.erp-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 20px 24px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  border: 1px solid #eef0f2;
}

@media (max-width: 768px) {
  .erp-page-header {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
}

/* 4. Filter Bar (Unified) */
.erp-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid #eef0f2;
}

.erp-filter-tabs {
  display: flex;
  gap: 4px;
}

.erp-filter-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--secondary-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.erp-filter-tab:hover {
  background: #f7fafc;
  color: #2d3748;
}

.erp-filter-tab.active {
  background: #edf2f7;
  color: #2d3748;
}

.erp-filter-tab svg {
  opacity: 0.7;
}

.erp-filter-tab.active svg {
  opacity: 1;
}

.erp-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #e2e8f0;
  color: #4a5568;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
}

.erp-filter-tab.active .erp-tab-count {
  background: var(--primary-color);
  color: #fff;
}

.erp-filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 5. Search Box (Unified) */
.erp-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.erp-search-box:focus-within {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.erp-search-box svg {
  color: #a0aec0;
  flex-shrink: 0;
}

.erp-search-box input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: #2d3748;
  width: 180px;
  outline: none;
}

.erp-search-box input::placeholder {
  color: #a0aec0;
}

/* 6. Select Dropdown (Unified) */
.erp-select {
  padding: 8px 32px 8px 12px;
  background: #f7fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #2d3748;
  cursor: pointer;
  appearance: none;
  transition: all var(--transition-fast);
}

.erp-select:hover {
  border-color: #cbd5e0;
}

.erp-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* 7. Stat Items (Unified) */
.erp-stats {
  display: flex;
  gap: 16px;
}

.erp-stat-item {
  text-align: center;
  padding: 10px 16px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  min-width: 80px;
  border: 1px solid #edf2f7;
}

.erp-stat-item.pending {
  background: #fffaf0;
  border-color: #feeebc;
}

.erp-stat-item.approved,
.erp-stat-item.completed {
  background: #f0fff4;
  border-color: #c6f6d5;
}

.erp-stat-item.rejected {
  background: #fff5f5;
  border-color: #fed7d7;
}

.erp-stat-item.partial {
  background: #ebf8ff;
  border-color: #bee3f8;
}

.erp-stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
}

.erp-stat-item.pending .erp-stat-value {
  color: var(--warning-color);
}

.erp-stat-item.approved .erp-stat-value,
.erp-stat-item.completed .erp-stat-value {
  color: var(--success-color);
}

.erp-stat-item.rejected .erp-stat-value {
  color: var(--danger-color);
}

.erp-stat-item.partial .erp-stat-value {
  color: var(--primary-color);
}

.erp-stat-label {
  font-size: 11px;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .erp-filter-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .erp-filter-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .erp-filter-tab {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .erp-filter-controls {
    flex-direction: column;
    gap: 8px;
  }

  .erp-search-box {
    width: 100%;
  }

  .erp-search-box input {
    width: 100%;
  }

  .erp-select {
    width: 100%;
  }

  .erp-stats {
    justify-content: space-between;
  }
}

/* 8. Inputs & Forms */
.erp-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.erp-input-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary-color);
  letter-spacing: 0.5px;
}

.erp-input {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

.erp-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background: #fff;
}

/* 4. Badges & Tags */
.erp-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  /* Rounded pill */
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.erp-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary-color);
}

/* 6. Utility Classes (Standard Spacing & Layout) */
.po-mb-4 {
  margin-bottom: 4px !important;
}

.po-mb-8 {
  margin-bottom: 8px !important;
}

.po-mb-12 {
  margin-bottom: 12px !important;
}

.po-mb-16 {
  margin-bottom: 16px !important;
}

.po-mb-20 {
  margin-bottom: 20px !important;
}

.po-mb-24 {
  margin-bottom: 24px !important;
}

.po-mb-32 {
  margin-bottom: 32px !important;
}

.po-mt-4 {
  margin-top: 4px !important;
}

.po-mt-8 {
  margin-top: 8px !important;
}

.po-mt-12 {
  margin-top: 12px !important;
}

.po-mt-16 {
  margin-top: 16px !important;
}

.po-mt-24 {
  margin-top: 24px !important;
}

.po-mt-32 {
  margin-top: 32px !important;
}

.po-mr-4 {
  margin-right: 4px !important;
}

.po-mr-8 {
  margin-right: 8px !important;
}

.po-ml-auto {
  margin-left: auto !important;
}

.po-p-0 {
  padding: 0 !important;
}

.po-p-12 {
  padding: 12px !important;
}

.po-p-16 {
  padding: 16px !important;
}

.po-p-20 {
  padding: 20px !important;
}

.po-p-24 {
  padding: 24px !important;
}

.po-flex {
  display: flex !important;
}

.po-flex-col {
  display: flex !important;
  flex-direction: column !important;
}

.po-flex-row {
  display: flex !important;
  align-items: center !important;
}

.po-flex-between {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.po-flex-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.po-flex-wrap {
  flex-wrap: wrap !important;
}

.po-flex-1 {
  flex: 1 !important;
}

.po-flex-2 {
  flex: 2 !important;
}

.po-gap-4 {
  gap: 4px !important;
}

.po-gap-8 {
  gap: 8px !important;
}

.po-gap-10 {
  gap: 10px !important;
}

.po-gap-12 {
  gap: 12px !important;
}

.po-gap-16 {
  gap: 16px !important;
}

.po-gap-24 {
  gap: 24px !important;
}

.po-max-w-420 {
  max-width: 420px !important;
}

.po-max-w-450 {
  max-width: 450px !important;
}

.po-max-w-500 {
  max-width: 500px !important;
}

.po-max-w-550 {
  max-width: 550px !important;
}

.po-max-w-700 {
  max-width: 700px !important;
}

.po-max-w-800 {
  max-width: 800px !important;
}

.po-max-w-850 {
  max-width: 850px !important;
}

.po-max-w-900 {
  max-width: 900px !important;
}

.po-max-w-980 {
  max-width: 980px !important;
}

.po-h-auto {
  height: auto !important;
}

.po-h-70vh {
  height: 70vh !important;
}

.po-h-80vh {
  height: 80vh !important;
}

.po-h-85vh {
  height: 85vh !important;
}

.po-max-h-90vh {
  max-height: 90vh !important;
}

.po-max-h-400 {
  max-height: 400px !important;
}

.po-grid-cols-2 {
  grid-template-columns: 1fr 1fr !important;
}

.po-grid-cols-2-1 {
  grid-template-columns: 2fr 1fr !important;
}

.po-grid-col-full {
  grid-column: 1 / -1 !important;
}

.po-bg-f9 {
  background: #f9fafb !important;
}

.po-bg-f0 {
  background: #f0f0f0 !important;
}

.po-bg-blue-light {
  background: #e0f2ff !important;
}

.po-bg-primary-light {
  background: var(--primary-light) !important;
}

.po-border-e2-b {
  border-bottom: 1px solid #e2e8f0 !important;
}

.po-border-e2-r {
  border-right: 1px solid #e2e8f0 !important;
}

.po-border-e2-l {
  border-left: 1px solid #e2e8f0 !important;
}

.po-border-eee {
  border: 1px solid #eee !important;
}

.po-border-f0 {
  border: 1px solid #f0f0f0 !important;
}

.po-border-t {
  border-top: 1px solid #eee !important;
}

.po-p-4-px {
  padding: 4px !important;
}

.po-p-0-4 {
  padding: 0 4px !important;
}

.po-p-0-16 {
  padding: 0 16px !important;
}

.po-p-10-16 {
  padding: 10px 16px !important;
}

.po-p-16-24 {
  padding: 16px 24px !important;
}

.po-p-2-6 {
  padding: 2px 6px !important;
}

.po-p-2-8 {
  padding: 2px 8px !important;
}

.po-p-4-8 {
  padding: 4px 8px !important;
}

.po-p-4-10 {
  padding: 4px 10px !important;
}

.po-p-6 {
  padding: 6px !important;
}

.po-m-4-0 {
  margin: 4px 0 !important;
}

.po-mr-42 {
  margin-right: 42px !important;
}

.po-nowrap {
  white-space: nowrap !important;
}

.po-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.po-line-height-14 {
  line-height: 1.4 !important;
}

.vendor-avatar-box {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.vendor-report-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.vendor-report-btn:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.vendor-report-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vendor-report-icon-box.blue {
  background: #f0f9ff;
  color: #007bff;
}

.vendor-report-icon-box.green {
  background: #f0fdf4;
  color: #16a34a;
}

/* Table Width Utilities */
.po-w-5 {
  width: 5% !important;
}

.po-w-10 {
  width: 10% !important;
}

.po-w-15 {
  width: 15% !important;
}

.po-w-20 {
  width: 20% !important;
}

.po-w-25 {
  width: 25% !important;
}

.po-w-30 {
  width: 30% !important;
}

.po-w-32 {
  width: 32px !important;
}

.po-h-32 {
  height: 32px !important;
}

.po-w-40 {
  width: 40% !important;
}

.po-w-50 {
  width: 50% !important;
}

.po-min-w-0 {
  min-width: 0 !important;
}

.po-min-w-160 {
  min-width: 160px !important;
}

.po-p-r-8 {
  padding-right: 8px !important;
}

.po-p-r-30 {
  padding-right: 30px !important;
}

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

.po-warning-text {
  color: #d97706 !important;
}

.po-border-l-3-orange {
  border-left: 3px solid #f59e0b !important;
}

.po-border-t-f0 {
  border-top: 1px solid #f0f0f0 !important;
}

.po-pt-12 {
  padding-top: 12px !important;
}

.po-rounded-4 {
  border-radius: 4px !important;
}

.po-rounded-6 {
  border-radius: 6px !important;
}

.po-h-1 {
  height: 1px !important;
}

.po-shadow-main {
  box-shadow: var(--shadow-main) !important;
}

.po-z-100 {
  z-index: 100 !important;
}

.po-r-0 {
  right: 0 !important;
}

.po-top-100 {
  top: 100% !important;
}

.po-mt-4 {
  margin-top: 4px !important;
}

.po-mb-2 {
  margin-bottom: 2px !important;
}

.po-mb-4 {
  margin-bottom: 4px !important;
}

.po-mb-8 {
  margin-bottom: 8px !important;
}

.po-gap-12-16 {
  gap: 12px 16px !important;
}

.po-gap-6 {
  gap: 6px !important;
}

/* Dynamic Modal System */
.dynamic-modal-card {
  animation: modalFadeIn 0.2s ease-out;
}

.modal-closing .dynamic-modal-card {
  animation: modalFadeOut 0.15s ease-in forwards;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
}

.erp-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
}

.erp-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.po-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

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

.po-danger-text {
  color: #ef4444 !important;
}

.po-alert-icon {
  flex-shrink: 0;
}

.po-items-center {
  align-items: center !important;
}

.po-flex-col {
  flex-direction: column !important;
}

.po-max-w-400 {
  max-width: 400px !important;
}

/* ========================================
   TOAST NOTIFICATION SYSTEM
   ======================================== */

.erp-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}

.erp-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #6b7280;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.erp-toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.erp-toast--hiding {
  opacity: 0;
  transform: translateX(100%);
}

.erp-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.erp-toast__message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
  word-break: break-word;
}

.erp-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.erp-toast__close:hover {
  color: #4b5563;
}

/* Toast Types */
.erp-toast--success {
  border-left-color: #10b981;
}

.erp-toast--success .erp-toast__icon {
  color: #10b981;
}

.erp-toast--error {
  border-left-color: #ef4444;
}

.erp-toast--error .erp-toast__icon {
  color: #ef4444;
}

.erp-toast--warning {
  border-left-color: #f59e0b;
}

.erp-toast--warning .erp-toast__icon {
  color: #f59e0b;
}

.erp-toast--info {
  border-left-color: #3b82f6;
}

.erp-toast--info .erp-toast__icon {
  color: #3b82f6;
}

/* ========================================
   LOADING STATES
   ======================================== */

.erp-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.erp-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary-color, #3b82f6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.erp-loading-spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.erp-loading-spinner--lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.erp-btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.erp-btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   ASSIGN MODAL SYSTEM (Original Design)
   ======================================== */

/* Assign Card Modal Base - Higher Specificity */
.modal-card.assign-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0 !important;
  /* Override order.css */
  max-width: 900px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  text-align: left !important;
  /* Override order.css */
}

/* Header */
.assign-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.assign-title-group {
  flex: 1;
}

.assign-title-group h3 {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
}

.assign-subtitle {
  font-size: 13px;
  color: #718096;
  display: block;
}

/* Body (Two-Panel Layout) */
.assign-body {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1px;
  background: #e2e8f0;
  flex: 1;
  overflow: hidden;
}

.assign-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-panel {
  flex: 1;
}

.right-panel {
  flex: 1.5;
  position: relative;
}

/* Panel Header */
.panel-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: 60px;
}

.panel-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #2d3748;
}

.panel-header .badge {
  background: var(--primary-color);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.panel-header .mini-search {
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 180px;
  outline: none;
  transition: border-color 0.2s;
}

.panel-header .mini-search:focus {
  border-color: var(--primary-color);
}

/* Assign Lists */
.assign-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assign-list.with-footer {
  padding-bottom: 80px;
}

/* Assign Item Styles */
.assign-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all 0.2s;
}

.assign-item:hover {
  background: #fff;
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.assign-item.current-item {
  background: #fff;
  border-color: #bee3f8;
}

.item-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.item-main img {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Fallback for any direct img inside assign-item */
.assign-item>img {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.assign-info {
  flex: 1;
  min-width: 0;
}

.assign-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.assign-top strong {
  font-size: 14px;
  color: #1a202c;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.qty-badge,
.stock-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.qty-badge {
  background: #e6f9ec;
  color: #16a34a;
}

.stock-badge {
  background: #e0f2ff;
  color: #0284c7;
}

.stock-badge.low-stock {
  background: #fef3c7;
  color: #d97706;
}

.assign-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.spec-tag {
  font-size: 11px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.assign-meta {
  font-size: 12px;
  color: #94a3b8;
}

.time-ago {
  font-size: 11px;
  color: #94a3b8;
}

.policy-error {
  font-size: 12px;
  color: #dc2626;
  background: #fee2e2;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.policy-info {
  font-size: 12px;
  color: #16a34a;
  margin-top: 4px;
}

/* Buttons */
.select-assign-btn,
.return-link-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  transition: all 0.2s;
}

.select-assign-btn:hover,
.return-link-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
}

.select-assign-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.return-link-btn {
  background: #f59e0b;
}

.return-link-btn:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Forms */
.assign-form,
.return-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e0;
}

.assign-form.hidden,
.return-form.hidden {
  display: none;
}

.assign-form input,
.return-form input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 8px;
}

.form-actions,
.ret-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.confirm-assign-btn,
.ret-confirm {
  flex: 1;
  padding: 8px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cancel-assign-btn,
.ret-cancel {
  flex: 1;
  padding: 8px;
  background: #e2e8f0;
  color: #64748b;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Tabs */
.assign-tabs {
  display: flex;
  gap: 8px;
}

.assign-tabs .tab-btn {
  padding: 8px 16px;
  border: none;
  background: #f7fafc;
  color: #64748b;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.assign-tabs .tab-btn.active {
  background: var(--primary-color);
  color: #fff;
}