/* ============================================
   Best3PL Portal — WordPress Theme
   Dark theme: #0D0D0D bg, #3B82F6 accent
   Font: DM Sans (loaded via JS)
   ============================================ */

/* ---------- Reset & Base ---------- */
#best3pl-portal *, #best3pl-portal *::before, #best3pl-portal *::after {
  box-sizing: border-box;
}

#best3pl-portal {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0D0D0D;
  color: #E5E7EB;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
#best3pl-portal h1 { font-size: 28px; font-weight: 700; color: #FFFFFF; margin-bottom: 8px; }
#best3pl-portal h2 { font-size: 22px; font-weight: 600; color: #FFFFFF; margin-bottom: 6px; }
#best3pl-portal h3 { font-size: 18px; font-weight: 600; color: #FFFFFF; margin-bottom: 4px; }
#best3pl-portal p { color: #9CA3AF; font-size: 14px; }
#best3pl-portal a { color: #3B82F6; text-decoration: none; }
#best3pl-portal a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.b3-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.b3-flex { display: flex; }
.b3-flex-col { display: flex; flex-direction: column; }
.b3-flex-wrap { flex-wrap: wrap; }
.b3-items-center { align-items: center; }
.b3-justify-between { justify-content: space-between; }
.b3-gap-4 { gap: 16px; }
.b3-gap-6 { gap: 24px; }

.b3-grid {
  display: grid;
  gap: 20px;
}
.b3-grid-2 { grid-template-columns: repeat(2, 1fr); }
.b3-grid-3 { grid-template-columns: repeat(3, 1fr); }
.b3-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .b3-grid-2, .b3-grid-3, .b3-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cards ---------- */
.b3-card {
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  padding: 24px;
}

.b3-card-hover:hover {
  border-color: #3B82F6;
  transition: border-color 0.2s ease;
}

/* ---------- Stat Cards ---------- */
.b3-stat-card {
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  padding: 20px;
}

.b3-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.b3-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #FFFFFF;
}

.b3-stat-sub {
  font-size: 12px;
  color: #6B7280;
  margin-top: 4px;
}

/* ---------- Buttons ---------- */
.b3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.b3-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.b3-btn-primary {
  background: #3B82F6;
  color: #FFFFFF;
}
.b3-btn-primary:hover:not(:disabled) {
  background: #2563EB;
}

.b3-btn-secondary {
  background: #1E1E1E;
  color: #E5E7EB;
  border: 1px solid #2A2A2A;
}
.b3-btn-secondary:hover:not(:disabled) {
  background: #2A2A2A;
}

.b3-btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}
.b3-btn-danger:hover:not(:disabled) {
  background: #B91C1C;
}

.b3-btn-success {
  background: #059669;
  color: #FFFFFF;
}
.b3-btn-success:hover:not(:disabled) {
  background: #047857;
}

.b3-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.b3-btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.b3-btn-full {
  width: 100%;
}

/* ---------- Forms ---------- */
.b3-form-group {
  margin-bottom: 16px;
}

.b3-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #9CA3AF;
  margin-bottom: 6px;
}

.b3-input, .b3-select, .b3-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #1E1E1E;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  color: #E5E7EB;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.b3-input:focus, .b3-select:focus, .b3-textarea:focus {
  outline: none;
  border-color: #3B82F6;
}

.b3-input::placeholder {
  color: #4B5563;
}

.b3-textarea {
  min-height: 100px;
  resize: vertical;
}

.b3-select {
  appearance: none;
  background-image: 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='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.b3-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.b3-error-text {
  color: #EF4444;
  font-size: 12px;
  margin-top: 4px;
}

.b3-success-text {
  color: #10B981;
  font-size: 12px;
  margin-top: 4px;
}

/* ---------- Tables ---------- */
.b3-table-wrap {
  overflow-x: auto;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
}

.b3-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.b3-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #161616;
  border-bottom: 1px solid #2A2A2A;
}

.b3-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1E1E1E;
  color: #E5E7EB;
}

.b3-table tr:last-child td {
  border-bottom: none;
}

.b3-table tr:hover td {
  background: #1A1A1A;
}

/* ---------- Badges / Status ---------- */
.b3-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.b3-badge-blue { background: rgba(59,130,246,0.15); color: #60A5FA; }
.b3-badge-green { background: rgba(16,185,129,0.15); color: #34D399; }
.b3-badge-yellow { background: rgba(245,158,11,0.15); color: #FBBF24; }
.b3-badge-red { background: rgba(239,68,68,0.15); color: #F87171; }
.b3-badge-gray { background: rgba(107,114,128,0.15); color: #9CA3AF; }
.b3-badge-purple { background: rgba(139,92,246,0.15); color: #A78BFA; }

/* ---------- Navigation / Sidebar ---------- */
.b3-layout {
  display: flex;
  min-height: 100vh;
}

.b3-sidebar {
  width: 250px;
  background: #111111;
  border-right: 1px solid #2A2A2A;
  padding: 24px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.b3-sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid #2A2A2A;
  margin-bottom: 16px;
}

.b3-sidebar-logo h2 {
  font-size: 20px;
  font-weight: 700;
  color: #3B82F6;
  margin: 0;
}

.b3-sidebar-logo span {
  font-size: 11px;
  color: #6B7280;
}

.b3-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #9CA3AF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.b3-nav-item:hover {
  color: #FFFFFF;
  background: #1A1A1A;
}

.b3-nav-item.active {
  color: #3B82F6;
  background: rgba(59,130,246,0.08);
  border-right: 3px solid #3B82F6;
}

.b3-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.b3-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ---------- Top Bar ---------- */
.b3-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

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

.b3-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #1E1E1E;
  border-radius: 8px;
  font-size: 13px;
  color: #E5E7EB;
}

.b3-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3B82F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
}

/* ---------- Tabs ---------- */
.b3-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #2A2A2A;
  margin-bottom: 24px;
}

.b3-tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: all 0.15s ease;
}

.b3-tab:hover {
  color: #E5E7EB;
}

.b3-tab.active {
  color: #3B82F6;
  border-bottom-color: #3B82F6;
}

/* ---------- Modal ---------- */
.b3-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.b3-modal {
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.b3-modal-lg {
  max-width: 700px;
}

.b3-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.b3-modal-close {
  background: none;
  border: none;
  color: #6B7280;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.b3-modal-close:hover {
  color: #FFFFFF;
}

/* ---------- Alerts / Toast ---------- */
.b3-alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.b3-alert-info {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60A5FA;
}

.b3-alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34D399;
}

.b3-alert-warning {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: #FBBF24;
}

.b3-alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #F87171;
}

.b3-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 10000;
  animation: b3-slide-up 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

@keyframes b3-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Loading ---------- */
.b3-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #2A2A2A;
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: b3-spin 0.6s linear infinite;
}

.b3-spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

.b3-loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}

/* ---------- Empty State ---------- */
.b3-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6B7280;
}

.b3-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ---------- Progress Bar ---------- */
.b3-progress-bar {
  width: 100%;
  height: 8px;
  background: #1E1E1E;
  border-radius: 4px;
  overflow: hidden;
}

.b3-progress-fill {
  height: 100%;
  background: #3B82F6;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ---------- Onboarding / Auth Pages ---------- */
.b3-auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.b3-auth-card {
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 16px;
  padding: 40px;
  max-width: 440px;
  width: 100%;
}

.b3-auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.b3-auth-logo h1 {
  font-size: 28px;
  color: #3B82F6;
  margin-bottom: 4px;
}

.b3-auth-logo p {
  color: #6B7280;
  font-size: 14px;
}

.b3-divider {
  border: none;
  border-top: 1px solid #2A2A2A;
  margin: 24px 0;
}

/* ---------- Onboarding Steps ---------- */
.b3-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.b3-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2A2A2A;
  transition: all 0.2s ease;
}

.b3-step-dot.active {
  background: #3B82F6;
  width: 32px;
  border-radius: 5px;
}

.b3-step-dot.completed {
  background: #10B981;
}

.b3-step-line {
  width: 24px;
  height: 2px;
  background: #2A2A2A;
}

/* ---------- ScanPower Connect ---------- */
.b3-connect-option {
  background: #1E1E1E;
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.b3-connect-option:hover {
  border-color: #3B82F6;
}

.b3-connect-option.selected {
  border-color: #3B82F6;
  background: rgba(59,130,246,0.05);
}

/* ---------- Password Strength ---------- */
.b3-pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.b3-pw-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #2A2A2A;
  transition: background 0.2s ease;
}

.b3-pw-bar.weak { background: #EF4444; }
.b3-pw-bar.fair { background: #F59E0B; }
.b3-pw-bar.good { background: #10B981; }

/* ---------- Activity Feed ---------- */
.b3-activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #1E1E1E;
}

.b3-activity-item:last-child {
  border-bottom: none;
}

.b3-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3B82F6;
  margin-top: 6px;
  flex-shrink: 0;
}

.b3-activity-text {
  font-size: 13px;
  color: #E5E7EB;
}

.b3-activity-time {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
}

/* ---------- Search Bar ---------- */
.b3-search {
  position: relative;
}

.b3-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #1E1E1E;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  color: #E5E7EB;
  font-size: 14px;
  font-family: inherit;
}

.b3-search-input:focus {
  outline: none;
  border-color: #3B82F6;
}

.b3-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6B7280;
  font-size: 16px;
}

/* ---------- Pagination ---------- */
.b3-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.b3-page-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #1E1E1E;
  border: 1px solid #2A2A2A;
  color: #E5E7EB;
  cursor: pointer;
  font-family: inherit;
}

.b3-page-btn.active {
  background: #3B82F6;
  border-color: #3B82F6;
  color: #FFFFFF;
}

.b3-page-btn:hover:not(.active) {
  background: #2A2A2A;
}

/* ---------- Responsive Sidebar Toggle ---------- */
@media (max-width: 900px) {
  .b3-sidebar {
    position: fixed;
    left: -260px;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .b3-sidebar.open {
    left: 0;
  }
  .b3-main {
    padding: 20px;
  }
  .b3-mobile-toggle {
    display: block !important;
  }
}

.b3-mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 8px;
  padding: 8px 12px;
  color: #E5E7EB;
  cursor: pointer;
  font-size: 20px;
}

.b3-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

/* ---------- Utility ---------- */
.b3-mt-2 { margin-top: 8px; }
.b3-mt-4 { margin-top: 16px; }
.b3-mt-6 { margin-top: 24px; }
.b3-mb-2 { margin-bottom: 8px; }
.b3-mb-4 { margin-bottom: 16px; }
.b3-mb-6 { margin-bottom: 24px; }
.b3-p-4 { padding: 16px; }
.b3-p-6 { padding: 24px; }
.b3-text-center { text-align: center; }
.b3-text-right { text-align: right; }
.b3-text-sm { font-size: 12px; }
.b3-text-muted { color: #6B7280; }
.b3-text-white { color: #FFFFFF; }
.b3-text-blue { color: #3B82F6; }
.b3-text-green { color: #10B981; }
.b3-text-red { color: #EF4444; }
.b3-text-yellow { color: #F59E0B; }
.b3-hidden { display: none; }
.b3-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b3-cursor-pointer { cursor: pointer; }
