/* ==========================================================================
   PAINEL DO TIME / DIRIGENTE AVV - LAYOUT ESTILO FEDERAÇÃO SISTEMA INTERNO
   ========================================================================== */

:root {
  --sidebar-bg: #272848;        /* Azul Escuro / Roxo institucional da Federação */
  --sidebar-active: #c5a021;    /* Dourado / Mostarda para item ativo */
  --sidebar-text: #cbd5e1;
  --sidebar-hover: rgba(255, 255, 255, 0.08);

  --panel-topbar-bg: #ffffff;
  --panel-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-ui: #e2e8f0;
  
  --gold-header: #c5a021;       /* Faixa Mostarda/Dourada dos headers */
  --btn-green: #107c41;         /* Verde institucional dos botões de ação/editar */
  --btn-green-hover: #0b5e31;

  --text-primary: #0f172a;
  --text-muted: #64748b;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--panel-bg);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ==========================================================================
   SIDEBAR LATERAL (ESTILO FEDERAÇÃO)
   ========================================================================== */
.sidebar-fed {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  border-right: 1px solid rgba(0,0,0,0.1);
}

.sidebar-fed-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-fed-logo {
  height: 38px;
  width: auto;
}

.sidebar-fed-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

.sidebar-section-label {
  padding: 20px 20px 8px 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94a3b8;
}

.sidebar-menu-fed {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-menu-fed li button {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  padding: 10px 14px;
  border-radius: 4px;
  text-align: left;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.sidebar-menu-fed li button:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-menu-fed li button.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 700;
}

/* FOOTER DA SIDEBAR (USUÁRIO / PERFIL COM DROPDOWN) */
.sidebar-fed-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.user-profile-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.user-profile-trigger:hover {
  background: var(--sidebar-hover);
}

.user-avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sidebar-bg);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 10px;
  color: #94a3b8;
}

.user-arrow-icon {
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-profile-trigger.active .user-arrow-icon {
  transform: rotate(180deg);
}

/* MENU SUSPENSO / POPUP DO PERFIL */
.user-dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 10px;
  right: 10px;
  background: #1e1f38;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
}

.user-dropdown-menu.active {
  display: flex;
}

.user-dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  color: #e2e8f0;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.user-dropdown-item.danger {
  color: #f87171;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
  padding-top: 10px;
}

.user-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* ==========================================================================
   CONTEÚDO PRINCIPAL & TOPBAR
   ========================================================================== */
.main-wrapper-fed {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.topbar-fed {
  height: 52px;
  background: var(--panel-topbar-bg);
  border-bottom: 1px solid var(--border-ui);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-breadcrumb strong {
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
}

.icon-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* ÁREA DE SCROLL DOS PAINÉIS */
.content-body-fed {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   BARRA DOURADA DE SEÇÃO & TABELAS / CARDS
   ========================================================================== */
.fed-header-gold {
  background: var(--gold-header);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 4px 4px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.fed-card-container {
  background: #ffffff;
  border: 1px solid var(--border-ui);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 24px;
  overflow: hidden;
}

/* LINHA DE CAMPEONATOS / INSCRIÇÃO */
.fed-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-ui);
  transition: background 0.15s;
}

.fed-list-item:last-child {
  border-bottom: none;
}

.fed-list-item:hover {
  background-color: #fafafa;
}

.item-left-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.item-shield-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.item-text-info h4 {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.item-meta-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.item-meta-sub span {
  display: inline-block;
  margin-right: 14px;
}

.btn-action-green {
  background: var(--btn-green);
  color: #ffffff;
  border: none;
  min-width: 34px;
  height: 34px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0 8px;
  white-space: nowrap;
}

.btn-action-green:has(svg:only-child),
.btn-action-green:not(:has(text)) {
  width: 34px;
  padding: 0;
}

.btn-action-green:hover {
  background: var(--btn-green-hover);
}

.btn-action-text-green {
  background: var(--btn-green);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  text-transform: uppercase;
}

.btn-action-text-green:hover {
  background: var(--btn-green-hover);
}

/* STATUS PILL */
.badge-status-approved {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-status-waiting {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ==========================================================================
   CARDS DE ATLETA (GRADE RETANGULAR RESPONSIVA COM DESTAQUE DA FOTO & ESCUDO)
   ========================================================================== */
#lista-cards-atletas {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  background: #f1f5f9;
}

.card-atleta-fed {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #16a34a; /* Friso superior verde de homologação */
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.card-atleta-fed:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 28, 63, 0.1);
  border-color: #94a3b8;
}

/* CABEÇALHO DO CARD (CHECKBOX, STATUS E EMBLEMA) */
.atleta-card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.atleta-checkbox-box {
  display: flex;
  align-items: center;
}

.atleta-checkbox-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1d72f2;
}

.atleta-top-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.atleta-tag-status {
  display: inline-flex;
  align-items: center;
  background: #16a34a;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ÁREA VISUAL PRINCIPAL DO ATLETA (FOTO AMPLA + EMBLEMA DO TIME) */
.atleta-card-inner {
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.atleta-photo-box {
  position: relative;
  width: 90px;
  height: 105px;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.atleta-img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

/* EMBLEMA DO TIME EM DESTAQUE */
.atleta-club-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0f1c3f;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 2px;
  object-fit: contain;
  z-index: 2;
}

.atleta-info-body {
  flex: 1;
  min-width: 0;
}

.atleta-nome-display {
  font-size: 14px;
  font-weight: 800;
  color: #0f1c3f;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.atleta-meta-txt {
  font-size: 11px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.atleta-meta-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 3px;
}

.atleta-meta-row:last-child {
  border-bottom: none;
}

.atleta-meta-label {
  color: #64748b;
  font-weight: 500;
}

.atleta-meta-val {
  font-weight: 700;
  color: #1e293b;
}

/* AÇÕES DO CARD NO RODAPÉ: [Editar, Ficha, Excluir] */
.atleta-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
}

.btn-card-action {
  border: 1px solid transparent;
  font-family: var(--font-family);
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-card-action svg {
  flex-shrink: 0;
}

/* BOTÃO EDITAR (AZUL CORPORATIVO AVV) */
.btn-blue-action {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.btn-blue-action:hover {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

/* BOTÃO FICHA (OURO / TEAL INSTITUCIONAL AVV) */
.btn-cyan-action {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}

.btn-cyan-action:hover {
  background: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

/* BOTÃO EXCLUIR (VERMELHO SUAVE / ALERTA) */
.btn-red-action {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-red-action:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* ==========================================================================
   FOLHA A4 OFICIAL DA FICHA COM MARCA D'ÁGUA DA AVV & IMPRESSÃO
   ========================================================================== */
.folha-a4-avv {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 720px;
  min-height: 980px;
  padding: 28px 32px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
  font-family: var(--font-family);
  color: #1e293b;
}

/* MARCA D'ÁGUA SUAVE CENTRAL */
.watermark-avv {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  width: 380px;
  opacity: 0.055;
  pointer-events: none;
  z-index: 1;
}

.watermark-avv img {
  width: 100%;
  height: auto;
  filter: grayscale(100%);
}

.tabela-ficha-dados {
  width: 100%;
  border-collapse: collapse;
}

.tabela-ficha-dados td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  vertical-align: top;
  font-size: 11px;
}

.tabela-ficha-dados label {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.tabela-ficha-dados strong {
  display: block;
  font-size: 11px;
  color: #0f1c3f;
}

/* REGRAS ESPECÍFICAS PARA IMPRESSÃO (@media print) */
@media print {
  body {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  body * {
    visibility: hidden !important;
  }
  
  #modal-ficha-atleta,
  #modal-ficha-atleta *,
  #modal-adm-ficha-atleta,
  #modal-adm-ficha-atleta *,
  #area-fichas-multiplas,
  #area-fichas-multiplas * {
    visibility: visible !important;
  }
  
  #modal-ficha-atleta,
  #modal-adm-ficha-atleta,
  #area-fichas-multiplas {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  .folha-a4-avv {
    box-shadow: none !important;
    padding: 10mm 15mm !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 270mm !important;
    page-break-after: always !important;
    break-after: page !important;
    margin: 0 !important;
    border: none !important;
  }

  .folha-a4-avv:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .watermark-avv {
    opacity: 0.07 !important;
  }
}

/* ==========================================================================
   NAVEGAÇÃO POR SUB-PÁGINAS: EQUIPES HOMOLOGADAS VS ATLETAS & COMISSÃO
   ========================================================================== */
.subtabs-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 20px;
}

.btn-subtab-pill {
  border: none;
  background: transparent;
  color: #475569;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-subtab-pill:hover {
  color: #0f1c3f;
  background: rgba(255, 255, 255, 0.5);
}

.btn-subtab-pill.active {
  background: #ffffff;
  color: #0f1c3f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.subtab-count-badge {
  background: #f1f5f9;
  color: #0f1c3f;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.btn-subtab-pill.active .subtab-count-badge {
  background: #0f1c3f;
  color: #ffffff;
  border-color: #0f1c3f;
}

.subpane-view {
  display: none;
}

.subpane-view.active {
  display: block;
  animation: fadeInPane 0.2s ease-in-out;
}

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

/* ==========================================================================
   TABELA / LISTA DE ATLETAS DA EQUIPE (VISUALIZAÇÃO & INCLUSÃO)
   ========================================================================== */
.table-avv-roster {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #ffffff;
}

.table-avv-roster th {
  background: #0f1c3f;
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-align: left;
  border: 1px solid #1e293b;
}

.table-avv-roster td {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: middle;
}

.table-avv-roster tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table-avv-roster tbody tr:hover {
  background: #f1f5f9;
}

.atleta-roster-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #cbd5e1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: #ffffff;
}

.chk-roster-custom {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #0f1c3f;
}

.badge-status-concluido {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-status-pendente {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.btn-table-icon {
  background: transparent;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-table-icon:hover {
  background: #e2e8f0;
}


