/* Staff Portal Styles (B2B Multi-Supplier & Orders Dashboard) */

:root {
  --staff-primary: #1877F2;
  --staff-dark: #0f172a;
  --staff-dark-card: #1e293b;
  --staff-border: #334155;
  --staff-text: #f8fafc;
  --staff-text-muted: #94a3b8;
  --staff-success: #10b981;
  --staff-warning: #f59e0b;
  --staff-danger: #ef4444;
  --staff-purple: #8b5cf6;
}

body.staff-portal-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #090d16;
  color: #e2e8f0;
  min-height: 100vh;
}

/* Staff Auth Overlay */
.staff-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.staff-auth-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.staff-auth-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(24, 119, 242, 0.15);
  color: #38bdf8;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}
.staff-auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px 0;
}
.staff-auth-desc {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 24px;
  line-height: 1.4;
}
.staff-input-pwd {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  box-sizing: border-box;
  margin-bottom: 16px;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
}
.staff-input-pwd:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}
.btn-staff-login {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  background: #1877F2;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-staff-login:hover {
  background: #1565c0;
}
.staff-auth-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 14px;
}

/* Staff Header */
.staff-header {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
}
.staff-header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.staff-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.staff-logo-group img {
  height: 28px;
  filter: brightness(0) invert(1);
}
.staff-badge-tag {
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid #334155;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs switcher in header */
.staff-nav-tabs {
  display: flex;
  background: #1e293b;
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  border: 1px solid #334155;
}
.staff-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.staff-tab-btn:hover {
  color: #f8fafc;
}
.staff-tab-btn.active {
  background: #1877F2;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(24, 119, 242, 0.4);
}
.staff-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 800;
}

/* Header actions right */
.staff-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-client-view {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-client-view:hover {
  background: #334155;
  color: #ffffff;
}
.btn-staff-logout {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-staff-logout:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Main Layout */
.staff-main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* Tab Panels */
.staff-panel {
  display: none;
}
.staff-panel.active {
  display: block;
}

/* Toolbar & Filters */
.staff-toolbar {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.staff-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.staff-search-input-wrap {
  position: relative;
  min-width: 320px;
}
.staff-search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}
.staff-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.staff-search-input:focus {
  border-color: #38bdf8;
}
.staff-select {
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.staff-filter-pills {
  display: flex;
  gap: 8px;
}
.staff-pill-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.staff-pill-btn:hover {
  color: #ffffff;
  border-color: #64748b;
}
.staff-pill-btn.active {
  background: #1877F2;
  color: #ffffff;
  border-color: #1877F2;
}

/* 3-Supplier Comparison Table */
.staff-table-wrap {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow-x: auto;
}
.staff-compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.staff-compare-table th {
  background: #0f172a;
  padding: 14px 16px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1f2937;
  white-space: nowrap;
}
.staff-compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}
.staff-compare-table tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

/* Supplier Columns Specific Styling */
.th-supplier-treolan {
  border-left: 2px solid #3b82f6 !important;
  color: #60a5fa !important;
}
.th-supplier-netlab {
  border-left: 2px solid #10b981 !important;
  color: #34d399 !important;
}
.th-supplier-merlion {
  border-left: 2px solid #f59e0b !important;
  color: #fbbf24 !important;
}
.td-supplier {
  border-left: 1px solid #1f2937;
  min-width: 190px;
}
.td-supplier.best-price-cell {
  background: rgba(16, 185, 129, 0.08);
}

.supplier-price-rub {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}
.supplier-price-usd {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.supplier-stock-info {
  font-size: 11px;
  margin-top: 4px;
}
.supplier-stock-info.in-stock {
  color: #10b981;
}
.supplier-stock-info.out-of-stock {
  color: #ef4444;
}
.supplier-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}
.supplier-link-btn.treolan {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.supplier-link-btn.treolan:hover {
  background: #3b82f6;
  color: #ffffff;
}
.supplier-link-btn.netlab {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.supplier-link-btn.netlab:hover {
  background: #10b981;
  color: #ffffff;
}
.supplier-link-btn.merlion {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.supplier-link-btn.merlion:hover {
  background: #f59e0b;
  color: #ffffff;
}

/* Product Info Cell */
.prod-info-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
}
.prod-thumb-mini {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: #ffffff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.prod-name-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-meta-line {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Margin / Saving Tag */
.best-dealer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}
.savings-amount {
  font-size: 11px;
  color: #10b981;
  margin-top: 4px;
  font-weight: 700;
}

/* Orders Dashboard Panel */
.orders-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.order-stat-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.order-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.order-stat-val {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
}
.order-stat-lbl {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.orders-table th {
  background: #0f172a;
  padding: 14px 16px;
  font-weight: 700;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1f2937;
}
.orders-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #1e293b;
  vertical-align: top;
}
.orders-table tr:hover td {
  background: rgba(30, 41, 59, 0.4);
}

/* Status Badges & Selector */
.status-select-wrap select {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.status-new {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4) !important;
}
.status-in_progress {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4) !important;
}
.status-reserved {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border-color: rgba(139, 92, 246, 0.4) !important;
}
.status-shipped {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Order Item list preview */
.order-items-snippet {
  max-width: 320px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-item-row-sm {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Attachments */
.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #38bdf8;
  margin-top: 4px;
}

/* Pagination */
.staff-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-top: 1px solid #1f2937;
  background: #0f172a;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.staff-page-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.staff-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.staff-page-btn:not(:disabled):hover {
  background: #334155;
}
