/* =========================
   1. VARIÁVEIS GLOBAIS
========================= */
:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --primary-color: #4db5ff;
  --secondary-color: #3a9dd8;
  --sidebar-bg: #2b2a3f;
  --sidebar-hover: #7d7e7f;
  --btn-card: #334155;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  --border-color: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);

  --mokapp-blue: #4db5ff;
  --mokapp-blue-dark: #3a9dd8;
  --mokapp-green: #00ff66;
  --mokapp-bg-light: #f4f4f4;
  --mokapp-text-light: #cccccc;
  --mokapp-toast-bg: rgba(0, 0, 0, 0.8);
  --mokapp-red: #dc3545;
  --mokapp-red-dark: #bb2d3b;
  --mokapp-navbar: #1c1c2c;

  --score-alerta: #dc3545;
  --score-atencao: #ffc107;
  --score-ok: #009944;

  --ok: #00e676;
  --warn: #ffd54f;
  --bad: #ff5252;
  --na: #e0e0e0;

  --first-col-w: 150px;
  --cell-size: 20px;
  --cell-gap: 2px;
  --cell-radius: 6px;
  --font-sm: 9px;
}

/* =========================
   2. ESTILOS GLOBAIS E RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  overflow-x: hidden;
}

/* Page-specific body styles */
body#result-cards {
  background-color: var(--mokapp-bg-light);
  font-family: Arial, sans-serif;
  padding-top: 70px;
}

body#login {
  background: url(../img/access-background.jpg) center center no-repeat;
  background-size: cover;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

@media (max-width: 800px) {
    body#login {
    background: url(../img/access-background-mobile.png) center center no-repeat;
    background-size: cover;
  }
}


/* =========================
   3. LAYOUT PRINCIPAL E ESTRUTURA
========================= */
.layout-wrapper {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 1rem;
}

.content-area {
  padding: calc(80px + 2rem) 2rem 2rem 2rem;
}

/* =========================
   4. COMPONENTE: SIDEBAR DE CONTROLE
   (o shell base — sidebar de navegação, área principal e cabeçalho —
    foi movido para core/static/css/base.css)
========================= */
.controle.sidebar {
  width: 25vw !important;
  background-color: #ffffff;
  border-left: 2px solid #eee;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
}

.controle.sidebar h5 {
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

.controle.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.controle.sidebar li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  padding: 4px 0;
}

.controle.sidebar .fa-check-circle {
  color: var(--score-ok);
}

.controle.sidebar .fa-times-circle {
  color: var(--score-alerta);
}

/* =========================
   6. COMPONENTE: CABEÇALHO SUPERIOR (NAVBAR)
========================= */
.navbar-custom {
  background-color: #1c1c2c;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
}

.header-btn:hover {
  background-color: #f1f5f9;
  color: #334155;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-profile:hover {
  background-color: #f1f5f9;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #1e293b;
}

.user-role {
  font-size: 0.75rem;
  color: #64748b;
}

/* =========================
   7. PÁGINA: CONTEÚDO E TÍTULOS
========================= */
.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

/* #page-title {
  font-size: 20px;
  color: #1c1c2c;
} */

.page-subtitle {
  color: #64748b;
  margin-bottom: 2rem;
}

.wellbeing-card {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 2rem;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.summary-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.summary-measure {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.card-wrapper {
  position: relative;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.card-box {
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 1050px;
  margin: 0 auto;
}

.section-title {
  margin: 0 auto 1rem;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.cards-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.card-img-top {
  width: 200px;
  height: 200px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  padding: 10px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 2px;
}

/* =========================
   8. COMPONENTE: CARDS MENU
========================= */
.btn-card {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 220px;
  height: 80px;
  font-size: 1.1rem;
  border-radius: 12px;
  transition: all 0.3s ease-in-out;
  background: var(--btn-card);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn-card i {
  font-size: 2rem;
  margin-right: 0.6rem;
}
.btn-card:hover {
  background: var(--sidebar-bg);
  transform: translateY(-4px);
}

/* =========================
   8.1 COMPONENTE: COMPARTILHAMENTO WHATSAPP
========================= */
.whatsapp-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1050px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  padding: 1.75rem 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #25d366;
}

.whatsapp-share-info {
  flex: 1;
}

.whatsapp-share-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.whatsapp-share-title i {
  color: #25d366;
}

.whatsapp-share-text {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 0;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.btn-whatsapp i {
  font-size: 1.4rem;
}

.btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-3px);
  color: #fff;
}

/* =========================
   9. COMPONENTE: ESCALA DE BEM-ESTAR
========================= */
.measure-section {
  margin-bottom: 2rem;
}

.measure-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-color);
}

.scale-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
}

.scale-number {
  font-weight: 700;
  text-align: center;
  background: #e2e8f0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: #475569;
}

.desktop-grid {
  display: grid;
  grid-template-columns: 200px repeat(5, 1fr);
  gap: 12px;
  align-items: center;
}

.mobile-section {
  margin-bottom: 2rem;
}

.mobile-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cell-btn {
  font-weight: bold;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  padding: 12px;
  width: 100%;
  min-height: 70px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cell-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cell-btn:active {
  transform: translateY(0);
}

.cell-btn.selected {
  border: 3px solid #1e293b !important;
  box-shadow: 0 0 0 2px rgba(30, 41, 59, 0.2);
  animation: pulse 0.3s ease-in-out;
}

/* Cores da Escala */
.level-na {
  background-color: #f0f0f0;
  color: #999;
}

.level-1,
.heatmap .level-1,
.heatmap .global-level-1 {
  background: linear-gradient(135deg, #e53935, #c62828) !important;
  color: #fff !important;
}

.level-2,
.heatmap .level-2,
.heatmap .global-level-2 {
  background: linear-gradient(135deg, #fbc02d, #f9a825) !important;
  color: #000 !important;
}

.level-3,
.heatmap .level-3,
.heatmap .global-level-3 {
  background: linear-gradient(135deg, #fdd835, #fbc02d) !important;
  color: #000 !important;
}

.level-4,
.heatmap .level-4,
.heatmap .global-level-4 {
  background: linear-gradient(135deg, #7cb342, #689f38) !important;
  color: #fff !important;
}

.level-5,
.heatmap .level-5,
.global-level-5 {
  background: linear-gradient(135deg, #43a047, #388e3c) !important;
  color: #fff !important;
}

/* =========================
   9.1 COMPONENTE: CARDS DE RESUMO (KPIs do Resumo do Wellness)
========================= */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.kpi-card .label {
  color: #667085;
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-card .label i {
  color: #000;
  width: 14px;
  text-align: center;
}

.kpi-card .value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #172033;
}

.kpi-card .sub {
  color: #667085;
  font-size: 13px;
  margin-top: 8px;
}

/* Variante colorida (cards de média): o fundo vem da classe level-* — a MESMA
   das células do heatmap — e o texto herda a cor de contraste do nível
   (#fff/#000 definidos nas regras .level-1..5), mantendo a leitura. */
.kpi-card--colored .label,
.kpi-card--colored .label i,
.kpi-card--colored .value,
.kpi-card--colored .sub {
  color: inherit;
}

.kpi-card--colored .label,
.kpi-card--colored .sub {
  opacity: 0.9;
}

@media (max-width: 860px) {
  .kpi-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================
   9.2 COMPONENTE: NAVEGAÇÃO DE MÊS (Resumo de Wellness)
========================= */
.month-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 210px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
}

.month-nav button {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.8rem;
  background: #fff;
}

.month-nav button:hover {
  background: #fcfafa;
}

.month-label-wrap {
  position: relative;
  flex: 1;
}

.month-label {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 6px;
  min-width: 108px;
  text-align: center;
  color: #1e293b;
}

/* Seletor nativo invisível sobreposto ao rótulo — o clique é disparado via
   showPicker() no JS, então ele fica sem eventos de ponteiro próprios. */
.month-native-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

/* =========================
   10. COMPONENTE: HEATMAP
========================= */
.heatmap-wrapper {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  white-space: nowrap;
}

.heatmap-header {
  display: grid;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  gap: var(--cell-gap);
  align-items: center;
  font-size: 0.8rem;
  color: #555;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.heatmap {
  display: grid;
  gap: 2px 0;
  align-items: center;
}

.heatmap-row {
  display: grid;
  gap: var(--cell-gap);
  align-items: center;
}

.col-name {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.athlete-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  padding: 0px 8px;
  white-space: nowrap;
  font-weight: 500;
  color: #222;
  font-size: 0.85rem;
  border-right: 1px solid var(--border-color);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.cell {
  width: 100%;
  min-width: var(--cell-size, 28px);
  height: var(--cell-size, 28px);
  border-radius: var(--cell-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  border: 1px solid #ddd;
  padding: 0;
  transition: all 0.2s;
}

.cell:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.cell:focus {
  outline: 2px solid #4db5ff;
  outline-offset: 2px;
}

/* =========================
   11. PÁGINA: LOGIN
========================= */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 50px 40px;
  width: 100%;
  max-width: 450px;
  /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
}

.login-card:hover {
  /* transform: translateY(-5px); */
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.logo-container {
  text-align: center;
  margin-bottom: 40px;
}

.logo-symbol {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin-bottom: 35px;
}

.login.form-control {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.login.form-control:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 0.2rem rgba(79, 172, 254, 0.25);
  background-color: white;
  transform: translateY(-2px);
}

.form-floating {
  margin-bottom: 20px;
}

.form-floating > label {
  color: #666;
  font-weight: 500;
}

.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 25px 0 30px 0;
}

.form-check-input:checked {
  background-color: #4facfe;
  border-color: #4facfe;
}

.form-check-label {
  color: #666;
  font-weight: 500;
}

.forgot-password {
  color: #4facfe;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #2b8ce6;
  text-decoration: underline;
}

.btn-login {
  background: linear-gradient(45deg, #20bf6b 0%, #01a3a4 100%);
  border: none;
  border-radius: 12px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(32, 191, 107, 0.4);
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:active {
  transform: translateY(0);
}

.loading {
  display: none;
}

/* =========================
   12. UTILITÁRIOS E ELEMENTOS DIVERSOS
========================= */
.score-box {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 60px;
  height: 60px;
  line-height: 60px;
  font-size: 30px;
  font-weight: bold;
  border-radius: 50%;
  text-align: center;
  color: white;
  z-index: 1;
}

.score-alerta {
  background-color: var(--score-alerta);
}

.score-atencao {
  background-color: var(--score-atencao);
  color: black;
}

.score-ok {
  background-color: var(--score-ok);
}

.camisa-number-wrapper {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 40px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 1;
}

.camisa-icon {
  font-size: 39px;
  color: white;
  text-shadow: 0 0 1px #000;
}

.camisa-num {
  position: absolute;
  font-size: 0.75rem;
  color: black;
  text-shadow: 0 0 3px white;
}

.badge {
  font-size: 0.75rem;
}

.underBadge {
  font-size: 7px;
}

.deslizar-hidden {
  overflow: hidden;
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.list-group-item {
  cursor: pointer;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.modal-header {
  background: var(--mokapp-navbar);
  color: white;
}

.modal-btn-salvar {
  background: var(--sidebar-bg);
  color: white;
  font-weight: 600;
}

.modal-btn-salvar:hover {
  background: var(--btn-card);
  color: white;
}

.breadcrumb-box {
  display: flex;
  align-items: center;
  margin-left: 40px;
  gap: 8px;
  border-radius: 10px;
  font-size: 14px;
}

.breadcrumb-box a {
  text-decoration: none;
  color: #374151;
}

.breadcrumb-box a:hover {
  text-decoration: underline;
}

.separator {
  color: #9ca3af;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* =========================
   13. RESPONSIVIDADE
========================= */
@media (max-width: 768px) {
  :root {
    --first-col-w: 140px;
    --cell-size: 18px;
    --font-sm: 8px;
  }

  /* .mobile-section {
    display: none;
  } */

  .cards-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .btn-card {
    width: 100%;
    max-width: 400px;
  }

  .whatsapp-share {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 1.25rem;
  }

  .whatsapp-share-title {
    justify-content: center;
    font-size: 1rem;
  }

  .whatsapp-share-title .fa-brands.fa-whatsapp {
    display: none;
  }

  .whatsapp-share-text {
    font-size: 12px;
  }

  .btn-whatsapp {
    width: 100%;
  }

  .user-info {
    display: none;
  }

  .content-area {
    padding: calc(60px + 1rem) 1rem 1rem 1rem;
  }

  .desktop-grid {
    display: none;
  }

  .wellbeing-card {
    padding: 1.5rem;
  }

  .layout-wrapper {
    flex-direction: column;
  }

  .controle.sidebar {
    width: 100%;
    border-left: none;
    border-top: 2px solid #eee;
    margin-top: 1rem;
  }

  .col-name {
    font-size: 10px;
    height: 20px;
  }
}

@media (max-width: 576px) {
  .login-card {
    padding: 30px 25px;
    margin: 10px;
  }

  .login-title {
    font-size: 20px;
  }
}

/* =========================
   14. ANIMAÇÕES
========================= */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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