/* B2B Order Management Dashboard Styles */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Header Styles */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.nav-links {
  margin-top: 1rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
  color: white;
  background: rgba(220, 53, 69, 0.8);
  border: none;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: inherit;
}

.logout-btn:hover {
  background: rgba(220, 53, 69, 1);
  transform: translateY(-1px);
}

.logout-btn:active {
  transform: translateY(0);
}

/* Layout Styles */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stat-title {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
}

.stat-body {
  padding: 1rem 1.5rem;
  color: #666;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.action-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.action-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.action-header h3 {
  margin: 0;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-body {
  padding: 1.5rem;
}

/* Button Styles */
.btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s;
  margin: 0.25rem;
  width: 100%;
  text-align: center;
}

.btn:hover {
  background: #5a6fd8;
}

.btn-success {
  background: #28a745;
}

.btn-success:hover {
  background: #218838;
}

.btn-warning {
  background: #ffc107;
  color: #333;
}

.btn-warning:hover {
  background: #e0a800;
}

/* Recent Activity */
.recent-activity {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.activity-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f8f9fa;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

.activity-icon.order {
  background: #28a745;
}

.activity-icon.business {
  background: #667eea;
}

.activity-icon.sku {
  background: #ffc107;
  color: #333;
}

.activity-icon.email {
  background: #17a2b8;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.activity-time {
  font-size: 0.9rem;
  color: #666;
}

/* System Status */
.system-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.status-item {
  background: white;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.status-indicator.online {
  background: #28a745;
}

.status-indicator.offline {
  background: #dc3545;
}

.status-indicator.warning {
  background: #ffc107;
}

/* Utility Classes */
.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
}

.modal-header {
  padding: 25px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header p {
  margin: 8px 0 0 0;
  color: #666;
}

.modal-body {
  padding: 25px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Form Styles */
.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
}

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

.checkbox-group {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.checkbox-item span {
  font-size: 0.9rem;
}

/* Business List */
.business-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 10px;
}

.business-item {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.business-item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

.business-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.business-item label {
  flex: 1;
  cursor: pointer;
  margin: 0;
}

.business-name {
  font-weight: 600;
  color: #333;
}

.business-email {
  font-size: 0.9rem;
  color: #666;
  margin-top: 2px;
}

.business-id {
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
}

/* Progress Indicator */
.progress-indicator {
  display: none;
  margin-bottom: 20px;
  padding: 15px;
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  color: #0066cc;
}

.progress-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #0066cc;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Results Display */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.result-card {
  text-align: center;
  padding: 15px;
  border-radius: 8px;
}

.result-card.success {
  background: #d4edda;
}

.result-card.error {
  background: #f8d7da;
}

.result-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.result-card.success .result-value {
  color: #155724;
}

.result-card.error .result-value {
  color: #721c24;
}

.result-label {
  font-size: 0.9rem;
}

.result-card.success .result-label {
  color: #155724;
}

.result-card.error .result-label {
  color: #721c24;
}

.result-details {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 8px;
}

.result-details.success {
  background: #d4edda;
}

.result-details.error {
  background: #f8d7da;
}

.result-details strong {
  color: #155724;
}

.result-details.error strong {
  color: #721c24;
}

.result-details ul {
  margin: 8px 0 0 20px;
}

.result-details.success ul {
  color: #155724;
}

.result-details.error ul {
  color: #721c24;
}

/* Hover Effects */
.modal-content button:hover {
  filter: brightness(110%);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }

  .container {
    padding: 0 0.5rem;
  }

  .stats-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    max-width: 100%;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .checkbox-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.text-muted {
  color: #666;
  margin-bottom: 1rem;
}

.section-title {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.1rem;
}

.btn-controls {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.btn-small {
  width: auto;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.btn-secondary {
  background: #6c757d;
}

.btn-close {
  margin-top: 20px;
  padding: 10px 20px;
}

.info-text {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #666;
}

.product-meta {
  color: #666;
  margin-bottom: 0.25rem;
}

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

.file-input {
  margin-bottom: 1rem;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.modal-footer.centered {
  justify-content: center;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-subsection {
  margin-bottom: 15px;
}

/* Print Window Styles */
.print-window-body {
  font-family: Arial, sans-serif;
  padding: 20px;
}

/* Footer Styles */
.footer {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-top: 3rem;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.5;
}

.footer-text a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-text a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Footer responsive design */
@media (max-width: 768px) {
  .footer {
    padding: 1.5rem 0;
    margin-top: 2rem;
  }

  .footer-text {
    gap: 0.75rem;
  }

  .footer-text p {
    font-size: 0.85rem;
  }
}
