/* ==========================================================================
   PORTAL ADMINISTRATIVO & CONFIGURAÇÕES (SCORE FINANCE / BEZERRA)
   Design System Premium Dark Mode
   ========================================================================== */

/* --- Container Principal do Portal --- */
.settings-portal-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 0 40px 0;
  animation: fadeIn 0.3s ease-in-out;
}

.portal-header {
  margin-bottom: 32px;
}

.portal-header-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-header-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
  font-weight: 400;
}

/* --- Grid de Cards do Portal Administrativo --- */
.portal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

@media (max-width: 860px) {
  .portal-cards-grid {
    grid-template-columns: 1fr;
  }
}

.portal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.portal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.12);
  background: #131c2e;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.2s ease;
}

.portal-card:hover::before {
  background: #00e5ff;
}

/* Ícone do Card (Caixa arredondada com borda ciano suave) */
.portal-card-icon-box {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.08);
  border: 1.5px solid rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00e5ff;
  transition: all 0.25s ease;
}

.portal-card:hover .portal-card-icon-box {
  background: rgba(0, 229, 255, 0.16);
  border-color: #00e5ff;
  color: #ffffff;
  transform: scale(1.05);
}

.portal-card-content {
  flex: 1;
}

.portal-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.portal-card-desc {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.portal-card-arrow {
  color: #475569;
  transition: all 0.2s ease;
}

.portal-card:hover .portal-card-arrow {
  color: #00e5ff;
  transform: translateX(3px);
}

/* --- Banner de Usuário Ativo & Papel --- */
.portal-active-user-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(0, 229, 255, 0.03));
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 14px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.portal-user-info-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-user-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #00e5ff;
  overflow: hidden;
  object-fit: cover;
}

.portal-user-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-user-meta-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.portal-user-meta-role {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-role-admin {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-role-seller {
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Botões do Portal */
.btn-portal-action {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00e5ff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-portal-action:hover {
  background: #00e5ff;
  color: #070a12;
  border-color: #00e5ff;
}

.btn-portal-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-portal-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* --- Modais do Portal Administrativo --- */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.settings-modal-box {
  background: #0e1524;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.settings-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(17, 24, 39, 0.5);
}

.settings-modal-title-group h2 {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-modal-title-group p {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0;
}

.settings-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.settings-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.settings-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(17, 24, 39, 0.4);
}

/* --- Tabela de Usuários --- */
.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.users-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  color: #cbd5e1;
  vertical-align: middle;
}

.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-identity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-cell-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #00e5ff;
  overflow: hidden;
}

.user-cell-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-cell-name {
  font-weight: 600;
  color: #ffffff;
}

.user-cell-username {
  font-size: 11.5px;
  color: #64748b;
}

/* --- Grid de Vendedores & Fotos --- */
.sellers-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.seller-profile-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

.seller-profile-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.seller-profile-card.inactive-seller {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.seller-card-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
}

.seller-card-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #00e5ff;
  object-fit: cover;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #00e5ff;
}

.seller-card-photo-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00e5ff;
  border: 2px solid #0e1524;
  color: #070a12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.seller-card-photo-btn:hover {
  transform: scale(1.15);
}

.seller-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.seller-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.seller-card-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
}

.tag-store-3 {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag-store-4 {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.tag-status-inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.seller-card-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.seller-card-actions button {
  flex: 1;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* --- Foto Upload Dropzone --- */
.photo-upload-dropzone {
  border: 2px dashed rgba(0, 229, 255, 0.3);
  background: rgba(0, 229, 255, 0.03);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.photo-upload-dropzone:hover {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.07);
}

.photo-preview-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #00e5ff;
  margin: 0 auto 12px auto;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  color: #00e5ff;
  font-size: 32px;
  font-weight: 800;
  overflow: hidden;
}

.photo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Formulário de Configuração */
.form-group-portal {
  margin-bottom: 16px;
}

.form-group-portal label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.portal-input {
  width: 100%;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.portal-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.15);
}

/* Avatar no Ranking Geral de Metas */
.seller-avatar-clean-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #00e5ff;
}

.seller-hero-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #00e5ff;
}

/* Botão de Perfil no Header */
.user-profile-badge-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 5px 12px 5px 6px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-badge-btn:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.3);
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #00e5ff;
  color: #070a12;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-user-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.header-user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.header-user-role-label {
  font-size: 10px;
  font-weight: 600;
  color: #00e5ff;
  letter-spacing: 0.02em;
}

/* Banner de Aviso quando logado como Vendedor */
.seller-restricted-mode-banner {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.15), rgba(16, 185, 129, 0.1));
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  padding: 8px 16px;
  font-size: 12px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
