/* ===============================
   OSSI Admin - Users Page Styles
   =============================== */

.user-list-container {
  max-height: 640px;
  overflow-y: auto;
}

.card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* User list */
.user-list-item {
  transition: all 0.18s ease;
  border-radius: 14px;
  cursor: pointer;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid transparent;
}
.user-list-item:hover {
  background-color: rgba(214, 33, 140, 0.05);
  border-color: rgba(214, 33, 140, 0.2);
}
.user-list-item.active {
  background-color: rgba(214, 33, 140, 0.1);
  border-left: 4px solid var(--primary);
}

/* Tabs */
.nav-tabs {
  border-bottom: 1px solid var(--gray-200);
}
.nav-tabs .nav-link {
  padding: 0.75rem 1.15rem;
}
.nav-tabs .nav-link:hover {
  color: var(--primary);
}
.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  background-color: transparent;
}

/* Forms */
.form-control, .form-select {
  transition: all 0.18s ease;
}
.form-control:focus, .form-select:focus {
  transform: none;
}

/* Avatar */
.user-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  margin-bottom: 1rem;
}

/* Address section */
.address-section {
  background-color: rgba(214, 33, 140, 0.03);
  border-radius: 14px;
  padding: 1rem;
  margin-top: 1rem;
}
.address-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.address-col {
  flex: 1;
}

/* Order cards (from orderhistory) */
.order-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  margin-bottom: 1rem;
  transition: all 0.2s;
}
.order-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(0,0,0,0.04);
}
.order-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(214,33,140,0.03), rgba(214,33,140,0.03));
}
.order-id {
  font-weight: 600;
  color: var(--gray-900);
}
.order-status-badge {
  padding: 0.375rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-confirmed { background: rgba(22,163,74,0.15); color: #16a34a; }
.status-pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-processing { background: rgba(124,58,237,0.15); color: #7c3aed; }
.status-shipped { background: rgba(37,99,235,0.15); color: #2563eb; }
.status-delivered { background: rgba(22,163,74,0.15); color: #16a34a; }
.status-canceled { background: rgba(220,38,38,0.15); color: #dc2626; }

.order-products {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}
.order-product-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
}
.product-count {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.order-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.order-actions {
  display: flex;
  justify-content: flex-end;
}

/* User contracts tab (reuses order-contract-card from contracts.css) */
.user-contracts-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.user-contract-card {
  margin: 0;
}

/* Activity tab */
.activity-panel {
  min-height: 200px;
}

.activity-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}

.activity-stat {
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.activity-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-light, #64748b);
  margin-bottom: 0.2rem;
}

.activity-stat strong {
  color: var(--ossi-navy, #0f172a);
  font-size: 0.95rem;
}

.activity-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
}

.activity-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 0.35rem;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
}
.toast {
  background-color: #fff;
  border: none;
  box-shadow: var(--box-shadow);
}
.toast-success { border-left: 4px solid #28a745; }
.toast-error { border-left: 4px solid #dc3545; }
.toast-info { border-left: 4px solid var(--primary); }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  box-shadow: var(--box-shadow);
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .user-list-container {
    max-height: 420px;
  }

  .user-avatar {
    width: 78px;
    height: 78px;
  }

  .address-row {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .order-card-header,
  .order-card-footer {
    padding: 0.85rem 1rem;
  }

  .order-card-header,
  .order-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .order-products {
    padding-bottom: 0.25rem;
  }

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