/* Vendors Management Styles */

.icon-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.icon-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.icon-btn svg {
  display: block;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 600px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-body {
  padding: 24px;
  max-height: calc(90vh - 160px);
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Button Styles */
.primary-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.primary-btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.secondary-btn {
  background: white;
  color: var(--secondary-color);
  border: 1px solid #ddd;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.secondary-btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.vendor-spec-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: #fafafa;
  border-radius: var(--radius-md);
  border: 1px solid #eee;
  max-height: 220px;
  overflow-y: auto;
}

.vendor-spec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: all var(--transition-fast);
}

.vendor-spec-item:hover {
  border-color: #cfe6ff;
  background: #f7fbff;
}

.vendor-spec-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.vendor-spec-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  font-size: 13px;
  margin: 0;
  padding: 8px;
}

.vendor-spec-group-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin-top: 4px;
  padding: 6px 4px;
  border-top: 1px solid #eee;
}

.vendor-spec-details {
  border: 1px solid #eee;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}

.vendor-spec-details>summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  background: #f8fafc;
}

.vendor-spec-details>summary::-webkit-details-marker {
  display: none;
}

.vendor-spec-count {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.vendor-spec-tools {
  padding: 12px 14px 0 14px;
}

.vendor-spec-tools input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.vendor-spec-tools input:focus {
  border-color: var(--primary-color);
}

.hidden {
  display: none !important;
}

.kebab-item:hover {
  background: #f8fafc;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 14px;
}

/* Categories Management */
.categories-management {
  padding: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    margin: 0;
  }

  .form-group {
    grid-column: 1 / -1 !important;
  }

  .vendor-spec-container {
    grid-template-columns: 1fr;
  }
}

/* Vendor Card Styles (Semantic) */
.vendor-card {
  padding: 20px;
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: all var(--transition-fast, 0.2s);
}

.vendor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.vc-header {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
}

.vc-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary-light, #e0e7ff);
  color: var(--primary-color, #4338ca);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-right: 14px;
  flex-shrink: 0;
}

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

.vc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.vc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-code {
  font-size: 11px;
  color: #4b5563;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
}

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

.vc-badge-cat {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.vc-badge-status-active {
  color: #059669;
  font-weight: 600;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vc-badge-status-active::before {
  content: "●";
  font-size: 10px;
}

.vc-badge-status-inactive {
  color: #9ca3af;
  font-weight: 600;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vc-badge-status-inactive::before {
  content: "●";
  font-size: 10px;
}

.vc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.vc-field {
  min-width: 0;
}

.vc-field-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.vc-field-val {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-specs {
  border-top: 1px solid #f3f4f6;
  padding-top: 16px;
  margin-top: auto;
}

.vc-specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vc-spec-tag {
  background: #f8fafc;
  color: #475569;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.vc-notes {
  margin-top: 16px;
  padding: 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #92400e;
  line-height: 1.4;
}

.vc-kebab {
  position: relative;
  align-self: flex-start;
  margin-left: 8px;
}

.vc-kebab-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.vc-kebab-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.vc-kebab-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 140px;
  z-index: 100;
  padding: 4px 0;
  margin-top: 4px;
}

.vc-kebab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}

.vc-kebab-item:hover {
  background: #f9fafb;
}

.vc-kebab-item.danger {
  color: #dc2626;
}

.vc-kebab-item.danger:hover {
  background: #fef2f2;
}

/* Parent Grid */
.vendors-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

/* ═══════════════════════════════════════════════════════
   Supplier Settings Page (vs-* components)
═══════════════════════════════════════════════════════ */

.vs-page { padding: 0; }

.vs-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.vs-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px;
}
.vs-page-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* Tabs */
.vs-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
}
.vs-tab {
  padding: 10px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.vs-tab:hover { color: #374151; }
.vs-tab.active {
  color: var(--primary-color, #4338ca);
  border-bottom-color: var(--primary-color, #4338ca);
  font-weight: 600;
}

/* Section Header */
.vs-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vs-section-count {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

/* Category Grid (Tab 1) */
.vs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.vs-cat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.15s;
}
.vs-cat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.vs-cat-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light, #e0e7ff);
  color: var(--primary-color, #4338ca);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.vs-cat-body { flex: 1; min-width: 0; }
.vs-cat-name {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  margin-bottom: 2px;
}
.vs-cat-desc {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}
.vs-cat-count {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.vs-cat-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Specializations (Tab 2) */
.vs-spec-group { margin-bottom: 20px; }
.vs-spec-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}
.vs-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fafafa;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background 0.15s;
}
.vs-cat-row:hover { background: #f5f5ff; border-color: #e0e7ff; }
.vs-cat-row-info { display: flex; align-items: center; gap: 10px; }
.vs-cat-row-name { font-size: 13px; font-weight: 600; color: #374151; }
.vs-cat-row-actions { display: flex; gap: 6px; }

/* Payment Terms (Tab 3) */
.vs-terms-table {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.vs-terms-header {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.vs-term-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.12s;
}
.vs-term-row:last-child { border-bottom: none; }
.vs-term-row:hover { background: #f9fafb; }
.vs-term-inactive { opacity: 0.5; }
.vs-term-inactive .vs-term-name { text-decoration: line-through; }
.vs-term-info { flex: 1; }
.vs-term-name { font-size: 14px; font-weight: 600; color: #111827; }
.vs-term-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }
.vs-term-actions { display: flex; align-items: center; gap: 8px; }

/* Toggle Switch */
.vs-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.vs-toggle-input { display: none; }
.vs-toggle-slider {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 20px;
  position: relative;
  transition: background 0.2s;
}
.vs-toggle-slider::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.vs-toggle-input:checked + .vs-toggle-slider {
  background: #22c55e;
}
.vs-toggle-input:checked + .vs-toggle-slider::after {
  transform: translateX(16px);
}

/* Empty State */
.vs-empty {
  padding: 32px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  font-style: italic;
}