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

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  animation: fadeInDown 0.6s ease-out;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease-out;
  transition: transform 0.3s ease;
}

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

.card h2 {
  color: var(--text-color);
  margin-bottom: 20px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Formulário */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-color);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Botões */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  width: 100%;
  justify-content: center;
}

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

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #059669;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning-color);
  color: white;
  padding: 8px 16px;
  font-size: 0.85rem;
}

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

/* Status da Fila */
.status-info {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.status-info strong {
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Lista de Corretores */
#listaCorretores {
  display: grid;
  gap: 15px;
}

.corretor-item {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid var(--secondary-color);
}

.corretor-item:hover {
  background: #f3f4f6;
  transform: translateX(5px);
}

.corretor-item.inativo {
  opacity: 0.6;
  border-left-color: var(--text-light);
}

.corretor-info {
  flex: 1;
}

.corretor-nome {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 5px;
}

.corretor-telefone {
  color: var(--text-light);
  font-size: 0.95rem;
}

.corretor-ultimo {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 5px;
}

.corretor-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 5px;
}

.status-ativo {
  background: #d1fae5;
  color: #065f46;
}

.status-inativo {
  background: #fee2e2;
  color: #991b1b;
}

.corretor-actions {
  display: flex;
  gap: 10px;
}

/* Toast de Notificações */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card-bg);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1000;
  max-width: 300px;
  border-left: 4px solid var(--secondary-color);
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-left-color: var(--danger-color);
}

.toast.success {
  border-left-color: var(--secondary-color);
}

/* Loading */
.loading {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
}

/* Animações */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge da posição na fila */
.fila-posicao {
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 10px;
}

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

  .card {
    padding: 20px;
  }

  .corretor-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .corretor-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
