/* Chat Admin Dashboard Styles */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #e0e0e0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 4px;
}

.header p {
  color: #a0a0a0;
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Statistics Section */
.stats-section {
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.stat-card.total .stat-icon {
  background: rgba(99, 102, 241, 0.2);
}

.stat-card.active .stat-icon {
  background: rgba(34, 197, 94, 0.2);
}

.stat-card.supervisors .stat-icon {
  background: rgba(245, 158, 11, 0.2);
}

.stat-card.branches .stat-icon {
  background: rgba(59, 130, 246, 0.2);
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.85rem;
  color: #a0a0a0;
}

/* Info Section */
.info-section {
  margin-bottom: 24px;
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 20px;
}

.info-box h3 {
  color: #60a5fa;
  margin-bottom: 12px;
  font-size: 1rem;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  font-size: 0.9rem;
  color: #a0a0a0;
}

.info-box li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #60a5fa;
}

.info-box strong {
  color: #e0e0e0;
}

/* Form Section */
.form-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section h2 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 20px;
}

.mapping-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.form-group label {
  font-size: 0.85rem;
  color: #a0a0a0;
}

.form-group input,
.form-group select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.9rem;
}

.form-group select {
  background: rgba(30, 30, 50, 0.9);
  color: #ffffff;
}

.form-group select option {
  background: #1a1a2e;
  color: #ffffff;
  padding: 8px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.15);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
}

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

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #10b981;
}

.checkbox-label {
  font-size: 0.9rem;
  color: #e0e0e0;
}

/* Table Section */
.table-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-header h2 {
  font-size: 1.2rem;
  color: #fff;
}

.table-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.table-actions select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 30, 50, 0.9);
  color: #ffffff;
  font-size: 0.85rem;
}

.table-actions select option {
  background: #1a1a2e;
  color: #ffffff;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(0, 0, 0, 0.3);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.loading {
  text-align: center;
  padding: 40px !important;
  color: #a0a0a0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.badge-inactive {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.badge-supervisor {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-redflag {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

.badge-audit {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.action-btn.edit {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.action-btn.edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.action-btn.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

.action-btn.test {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.action-btn.test:hover {
  background: rgba(34, 197, 94, 0.3);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-small {
  max-width: 400px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #a0a0a0;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #fff;
}

.modal-content .form-group {
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.delete-details {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: #f87171;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .mapping-form .form-row {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
  }

  .table-header {
    flex-direction: column;
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
