/* ===== VARIÁVEIS GLOBAIS ===== */
:root {
    --primary-color: #000000;
    --secondary-color: ##0f02dd;
    --dark-color: #0f1116;
    --light-color: #f8fafc;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --gray-color: #64748b;
    --light-gray: #f1f5f9;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET E ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background-color: #323435;
  color: var(--dark-color);
  line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem;
}

/* ===== COMPONENTES ===== */



  .logout-btn {
            background: rgba(231, 74, 59, 0.2);
            color: #e74a3b;
            border-radius: 6px;
            padding: 6px 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: var(--transition);
            text-decoration: none;
        }

.logo h1 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

/* CARDS */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

.card-header {
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-footer {
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--light-gray);
}

/* BOTÕES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: none;
}

.btn-primary {
  background-color: #5a5a61;
  color: #000000;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--gray-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--dark-color);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
  transform: translateY(-2px);
}

/* FORMULÁRIOS */
.form-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-gray);
}

.form-section h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* UPLOAD DE FOTO */
.photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.photo-preview {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid white;
  box-shadow: var(--box-shadow);
}

.photo-preview .current-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-photo-icon {
  font-size: 5rem;
  color: var(--gray-color);
}

/* PERFIL DE USUÁRIO */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-identity {
  flex: 1;
}

.profile-actions {
  display: flex;
  gap: 1rem;
}

.profile-alias {
  font-style: italic;
  color: var(--gray-color);
}

/* DETALHES */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.detail-item {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.detail-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.detail-label {
  font-weight: 600;
  color: var(--dark-color);
  display: block;
  margin-bottom: 0.25rem;
}

.detail-value {
  color: var(--gray-color);
}

/* DOCUMENTOS */
.document-section {
  background: var(--light-gray);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
}

/* MAPA */
.map-container {
  height: 400px;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-top: 1rem;
  box-shadow: var(--box-shadow);
}

.map-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-color);
}

/* FOOTER */
.footer {
  background-color: var(--dark-color);
  color: white;
  padding: 0.3rem 0;
  margin-top: 1rem;
}

.footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* UTILITÁRIOS */
.text-muted {
  color: var(--gray-color);
}

.text-center {
  text-align: center;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
  }

  .nav-links {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-actions {
    justify-content: center;
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .photo-upload {
    flex-direction: column;
  }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center; /* Adicionado para melhor alinhamento */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

.chart-container {
            background: white;
            border-radius: var(--border-radius);
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: var(--box-shadow);
        }

        .map-container {
            height: 400px;
            border-radius: var(--border-radius);
            overflow: hidden;
            margin-top: 1rem;
            box-shadow: var(--box-shadow);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stats-card {
            background: white;
            border-radius: var(--border-radius);
            padding: 1.5rem;
            box-shadow: var(--box-shadow);
        }

        .distribution-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }

        .distribution-table th, .distribution-table td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid var(--light-gray);
        }

        .distribution-table th {
            background-color: var(--light-gray);
        }

        /* ===== RELACIONAMENTOS ===== */
.relationship-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.relationship-center {
    position: relative;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.relationship-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.relationship-node.main-node {
    position: relative;
}

.node-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: var(--box-shadow);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-node .node-photo {
    width: 100px;
    height: 100px;
    border-width: 4px;
}

.node-photo.no-photo {
    background: var(--light-gray);
    color: var(--gray-color);
    font-size: 2.5rem;
}

.main-node .node-photo.no-photo {
    font-size: 3.5rem;
}

.node-name {
    margin-top: 0.5rem;
    font-weight: 600;
    text-align: center;
    max-width: 120px;
    word-break: break-word;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: var(--box-shadow);
}

.relationship-link {
    position: absolute;
    height: 2px;
    background: var(--gray-color);
    transform-origin: 0 0;
    z-index: 1;
}

.relationship-link::after {
    content: attr(data-relationship);
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    box-shadow: var(--box-shadow);
    color: var(--dark-color);
}

.relationship-controls {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.suggestions-container h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.suggestion-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.suggestion-photo i {
    color: var(--gray-color);
    font-size: 1.25rem;
}

.suggestion-info {
    font-size: 0.9rem;
}

.suggestion-name {
    font-weight: 600;
}

.suggestion-faction {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.add-relationship-form {
    display: flex;
    gap: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--box-shadow-lg);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.close-modal:hover {
    color: var(--dark-color);
}

/* Rede de Relacionamentos */
#networkGraph {
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
    background: white;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.graph-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-color);
    font-size: 1rem;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 50%;
}

.btn-icon:hover {
    background: var(--light-gray);
    color: var(--dark-color);
}

/* Legenda */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* Níveis de relacionamento */
.direct-node {
    border: 3px solid var(--primary-color);
}

.indirect-node {
    border: 3px solid var(--warning-color);
}

/* Estilos para endereços */
.endereco-item {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
}

.endereco-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.endereco-info {
    flex: 1;
}

.endereco-rua {
    display: block;
    font-weight: 600;
}

.endereco-cidade {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.endereco-coords {
    font-size: 0.8rem;
    color: var(--gray-color);
    font-family: monospace;
}

.mini-map {
    height: 200px;
    margin-top: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--box-shadow-lg);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.close-modal:hover {
    color: var(--dark-color);
}

/* Estilos para o organograma */
.orgchart {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
    margin: 0 auto;
}

.orgchart-container {
    border: none !important;
    background: transparent !important;
}

.orgchart .node {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.orgchart .node:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.orgchart .node .title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.orgchart .node .content {
    font-weight: 500;
    color: var(--dark-color);
}

.orgchart .lines .downline {
    background-color: var(--gray-color);
}

.orgchart .lines .rightline,
.orgchart .lines .leftline {
    border-color: var(--gray-color);
}

/* Garante que o select seja visível */
.form-control {
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Destaca opções */
select option {
    padding: 8px;
}

/* Estilos para o organograma */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    overflow: auto;
    margin-top: 20px;
}

.orgchart {
    background: transparent;
    padding: 20px;
}

.orgchart .node {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 10px;
    width: 160px;
}

.orgchart .node .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.orgchart .node .title {
    font-size: 12px;
    color: #666;
}

.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

/* Organograma melhorado */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    overflow: auto;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.orgchart {
    background: transparent;
    padding: 20px;
    min-width: 100%;
    display: inline-block;
}

.orgchart .node {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 12px;
    width: 180px;
    transition: all 0.3s ease;
    text-align: center;
}

.orgchart .node:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.orgchart .node .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid #e0e0e0;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
    word-break: break-word;
}

.orgchart .node .title {
    font-size: 12px;
    color: white;
    background-color: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 5px;
}

.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

.orgchart .node.lider {
    border: 2px solid #ef4444;
}

.orgchart .node.lider .title {
    background-color: #ef4444;
}

.orgchart .node.vice-lider {
    border: 2px solid #f59e0b;
}

.orgchart .node.vice-lider .title {
    background-color: #f59e0b;
}

.orgchart .node.capitao {
    border: 2px solid #10b981;
}

.orgchart .node.capitao .title {
    background-color: #10b981;
}

.orgchart .node.soldado {
    border: 1px solid #94a3b8;
}

.orgchart .node.soldado .title {
    background-color: #94a3b8;
}

/* Linhas do organograma */
.orgchart .lines .downline {
    background-color: #94a3b8;
    width: 2px;
}

.orgchart .lines .leftline,
.orgchart .lines .rightline {
    border-color: #94a3b8;
}

/* Controles de zoom */
.orgchart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 5px;
}

.orgchart-controls button {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.orgchart-controls button:hover {
    background: #f1f5f9;
}

/* Mensagem quando não há facção */
.no-faction-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
}

.no-faction-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.no-faction-message p {
    font-size: 1.1rem;
}

/* Avatar padrão quando não há foto */
.avatar.no-photo {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.5rem;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
/* Estilos para o organograma */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    overflow: auto;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}

.orgchart {
    background: transparent;
    padding: 20px;
}

.orgchart .node {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 12px;
    width: 180px;
    text-align: center;
}

.orgchart .node .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid #e0e0e0;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.orgchart .node .title {
    font-size: 12px;
    color: white;
    background-color: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

.avatar.no-photo {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.5rem;
}

/* Estilos para o organograma */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    overflow: auto;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.orgchart {
    background: transparent;
    padding: 20px;
    min-width: 100%;
    display: inline-block;
}

.orgchart .node {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 12px;
    width: 180px;
    transition: all 0.3s ease;
    text-align: center;
}

.orgchart .node:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.orgchart .node .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid #e0e0e0;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
    word-break: break-word;
}

.orgchart .node .title {
    font-size: 12px;
    color: white;
    background-color: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 5px;
}

.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

.avatar.no-photo {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.5rem;
}

/* Mensagens de estado */
.no-faction-message,
.loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
}

.no-faction-message i,
.loading-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.loading-message i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100% - 2rem);
    text-align: center;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Estilos do Organograma */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: auto;
    position: relative;
}

.orgchart {
    background: transparent;
    padding: 20px;
    min-width: 100%;
    display: inline-block;
}

.orgchart .node {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 12px;
    width: 180px;
    text-align: center;
    transition: all 0.3s ease;
}

.orgchart .node:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.orgchart .node .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid #e0e0e0;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.orgchart .node .title {
    font-size: 12px;
    color: white;
    background: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Classes de posição */
.orgchart .node.lider { border-color: #ef4444; }
.orgchart .node.lider .title { background: #ef4444; }
.orgchart .node.vice-lider { border-color: #f59e0b; }
.orgchart .node.vice-lider .title { background: #f59e0b; }
.orgchart .node.capitao { border-color: #10b981; }
.orgchart .node.capitao .title { background: #10b981; }
.orgchart .node.soldado { border-color: #94a3b8; }
.orgchart .node.soldado .title { background: #94a3b8; }

/* Usuário atual */
.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

/* Mensagens de estado */
.no-data, .loading, .error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
}

.no-data i, .loading i, .error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.loading i {
    animation: spin 1s linear infinite;
}

.error i {
    color: #ef4444;
}

.btn-retry {
    background: #6366f1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-top: 1rem;
    cursor: pointer;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Estilos do Organograma */
#organogramaContainer {
    width: 100%;
    height: 600px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: auto;
    position: relative;
}

.orgchart {
    background: transparent;
    padding: 20px;
    min-width: 100%;
    display: inline-block;
}

.orgchart .node {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    padding: 12px;
    width: 180px;
    text-align: center;
    transition: all 0.3s ease;
}

.orgchart .node:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.orgchart .node .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid #e0e0e0;
}

.orgchart .node .name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.orgchart .node .title {
    font-size: 12px;
    color: white;
    background: #6366f1;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Classes de posição */
.orgchart .node.lider { border-color: #ef4444; }
.orgchart .node.lider .title { background: #ef4444; }
.orgchart .node.vice-lider { border-color: #f59e0b; }
.orgchart .node.vice-lider .title { background: #f59e0b; }
.orgchart .node.capitao { border-color: #10b981; }
.orgchart .node.capitao .title { background: #10b981; }
.orgchart .node.soldado { border-color: #94a3b8; }
.orgchart .node.soldado .title { background: #94a3b8; }

/* Usuário atual */
.orgchart .node.current-user {
    background-color: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
}

/* Mensagens de estado */
.no-data, .loading, .error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
}

.no-data i, .loading i, .error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #94a3b8;
}

.loading i {
    animation: spin 1s linear infinite;
}

.error i {
    color: #ef4444;
}

.error-detail {
    font-size: 0.9rem;
    color: #b91c1c;
    margin-top: 0.5rem;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Estilos para o upload de foto */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
}

.photo-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed #d1d5db;
    margin-bottom: 10px;
    position: relative;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-photo {
    text-align: center;
    color: #6b7280;
}

.no-photo i {
    font-size: 60px;
    display: block;
    margin-bottom: 5px;
}

.no-photo span {
    font-size: 12px;
    display: block;
}

.upload-actions {
    display: flex;
    gap: 10px;
}

.btn-upload {
    background-color: #1c1863;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.btn-upload:hover {
    background-color: #4338ca;
}

.btn-clear {
    background-color: #f3f4f6;
    color: #6b7280;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    border: none;
}

.btn-clear:hover {
    background-color: #e5e7eb;
}

.btn-clear:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-text {
    color: #6b7280;
    font-size: 12px;
    margin-top: 5px;
}

.match-profile {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 1rem;
            background: #f9fafb;
            border-radius: 12px;
            padding: 1rem;
            box-shadow: 0 0 10px rgba(0,0,0,0.05);
        }
        .match-header {
            margin-bottom: 1rem;
        }
        .confidence-bar {
            position: relative;
            height: 12px;
            background: #e5e7eb;
            border-radius: 6px;
            margin-top: 18px;
        }
        .confidence-fill {
            background: #10b981;
            height: 100%;
            border-radius: 6px;
        }
        .confidence-value {
            position: absolute;
            top: -24px;
            right: 0;
            font-size: 0.9rem;
        }
        .match-photo img {
            max-width: 80px;
            border-radius: 8px;
            box-shadow: 0 0 5px rgba(0,0,0,0.1);
        }
        .match-card {
            background: white;
            border-radius: 10px;
            padding: 10px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
            display: flex;
            gap: 10px;
            align-items: center;
        }
        .match-info {
            flex-grow: 1;
        }
        .match-similarity {
            margin-top: 0.5rem;
        }
        .similarity-bar {
            background: #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            height: 10px;
        }
        .similarity-fill {
            background: #3b82f6;
            height: 10px;
        }

        .orgchart .avatar {
    width: 60px;
    height: 60px;
}
@media (max-width: 768px) {
    .orgchart .avatar {
        width: 40px;
        height: 40px;
    }
}
.spinner {
            border: 4px solid rgba(0,0,0,0.1);
            border-left-color: #6366f1;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: auto;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        .members-count {
            font-weight: bold;
            margin-bottom: 10px;
            color: #333;
        }
        .controls-container {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }
        .form-control { padding: 5px; min-width: 200px; }

 .login-page {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
        }

        .login-card {
            width: 100%;
            max-width: 400px;
            background: white;
            border-radius: var(--border-radius);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            overflow: hidden;
        }

        .login-header {
            background: #020d2b;
            color: white;
            padding: 1.5rem;
            text-align: center;
        }

        .login-body {
            padding: 2rem;
        }

 /* Adicione estas regras no seu arquivo CSS */
.profile-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-photo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.no-photo-large {
    font-size: 120px;
    color: #ccc;
}

/* Estilos para a imagem analisada */
.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f8f8;
    margin: 0 auto;
}

#analyzedImage {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

/* Estilos adicionais específicos para esta página */
        :root {
            --primary: #2563eb;
            --secondary: #1e40af;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --light: #f8fafc;
            --dark: #1e293b;
            --gray: #64748b;
        }

        .results-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: white;
            padding: 1.5rem;
            border-radius: 12px 12px 0 0;
            margin-bottom: 1.5rem;
        }

        .results-summary {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 2rem;
            padding: 1rem;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        .summary-card {
            flex: 1;
            min-width: 200px;
            text-align: center;
            padding: 1rem;
        }

        .summary-card i {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

        .summary-card h4 {
            margin-bottom: 0.5rem;
            color: var(--gray);
        }

        .summary-card .value {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--dark);
        }

        .image-section {
            margin-bottom: 2.5rem;
        }

        .image-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }

        .image-wrapper {
            position: relative;
            display: inline-block;
            max-width: 100%;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            overflow: hidden;
            background: #f8fafc;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        .face-marker {
            position: absolute;
            border: 3px solid var(--warning);
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 10;
        }

        .face-marker:hover {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
        }

        .face-marker span {
            position: absolute;
            top: -15px;
            left: -15px;
            background: var(--warning);
            color: white;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.9rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        .face-marker .marker-tooltip {
            position: absolute;
            bottom: -40px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--dark);
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 0.85rem;
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .face-marker:hover .marker-tooltip {
            opacity: 1;
        }

        .results-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .tab-button {
            padding: 0.75rem 1.5rem;
            background: #e2e8f0;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .tab-button.active, .tab-button:hover {
            background: var(--primary);
            color: white;
        }

        .similarity-badge {
            background: var(--success);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.85rem;
        }

        .result-content {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .result-content.active {
            display: block;
        }

        .best-match {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        .match-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .confidence-bar {
            height: 10px;
            background: #e2e8f0;
            border-radius: 5px;
            margin-top: 1.5rem;
            position: relative;
        }

        .confidence-fill {
            height: 100%;
            background: var(--success);
            border-radius: 5px;
        }

        .confidence-value {
            position: absolute;
            top: -25px;
            right: 0;
            font-weight: 600;
            color: var(--success);
        }

        .match-profile {
            display: flex;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .profile-photo {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
            border: 4px solid white;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        }

        .profile-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-photo .no-photo {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            background: #e2e8f0;
            color: #94a3b8;
            font-size: 3rem;
        }

        .profile-details {
            flex: 1;
            min-width: 300px;
        }

        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }

        .detail-item {
            background: #f1f5f9;
            padding: 0.75rem;
            border-radius: 8px;
        }

        .detail-item label {
            display: block;
            font-weight: 600;
            margin-bottom: 0.25rem;
            color: var(--gray);
        }

        .profile-actions {
            flex-shrink: 0;
        }

        .other-matches {
            margin-top: 2rem;
        }

        .matches-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }

        .match-card {
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .match-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        }

        .match-photo {
            width: 100%;
            height: 180px;
            overflow: hidden;
            background: #f1f5f9;
        }

        .match-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .match-card:hover .match-photo img {
            transform: scale(1.05);
        }

        .match-photo .no-photo {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            color: #94a3b8;
            font-size: 3rem;
        }

        .match-info {
            padding: 1.25rem;
        }

        .match-info h6 {
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
        }

        .match-meta {
            display: flex;
            gap: 1rem;
            margin-bottom: 1rem;
            color: var(--gray);
            font-size: 0.9rem;
        }

        .similarity-bar {
            height: 8px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .similarity-fill {
            height: 100%;
            background: var(--primary);
        }

        .match-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
        }

        .btn-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--dark);
            transition: all 0.3s ease;
        }

        .btn-icon:hover {
            background: var(--primary);
            color: white;
        }

        .no-results {
            text-align: center;
            padding: 3rem;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
            margin: 2rem 0;
        }

        .no-results-icon {
            font-size: 4rem;
            color: #94a3b8;
            margin-bottom: 1.5rem;
        }

        .action-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-top: 2rem;
        }

        .btn-secondary {
            background: #e2e8f0;
            color: var(--dark);
        }

        .btn-secondary:hover {
            background: #cbd5e1;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (max-width: 768px) {
            .match-profile {
                flex-direction: column;
                align-items: flex-start;
            }

            .profile-actions {
                width: 100%;
                margin-top: 1rem;
            }

            .profile-actions .btn {
                width: 100%;
            }

            .image-controls {
                flex-direction: column;
                align-items: flex-start;
            }
        }

        /* ==== MENU MODERNO ==== */
.modern-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e293b, #111827);
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--box-shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: max-height 0.3s ease-in-out;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-link:hover::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        margin-top: 1rem;
    }

    .nav-links.open {
        max-height: 500px;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 0.5rem 0;
    }
}

 /* Estilos adicionais para formatação do histórico */
        .formatted-history {
            white-space: pre-wrap;
            word-wrap: break-word;
            line-height: 1.6;
            padding: 1rem;
            background-color: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #2563eb;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .history-section {
            margin-top: 1.5rem;
        }

        .history-placeholder {
            color: #6c757d;
            font-style: italic;
        }
/* Estilos para marcadores coloridos por facção */
.marker-container img {
    border: 3px solid !important; /* A cor será definida inline */
}

.no-photo-marker {
    border: 3px solid white !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.popup-content {
    max-width: 300px;
}

.popup-content img {
    border-radius: 4px;
    margin-top: 5px;
}
