/* ==========
   Paleta Idealize
   ========== */
:root {
  --idealize-dark: #08313A;        /* azul escuro do texto */
  --idealize-teal: #009E9A;        /* teal principal */
  --idealize-teal-dark: #007D79;   /* teal mais escuro */
  --idealize-teal-light: #00B3AC;  /* teal claro */
  --idealize-orange: #F79C2E;      /* laranja da logo */

  --background: #F5F8FA;
  --card-bg: #FFFFFF;
  --text-main: #08313A;
}

/* ==========
   Base
   ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: var(--background);
  color: var(--text-main);
}

/* ==========
   Topo / Header
   ========== */
.topbar {
  background: #ffffff;
  color: var(--idealize-dark);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--idealize-dark);
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--idealize-dark);
}

.brand p {
  font-size: 13px;
  color: #64748b;
}

/* ==========
   Layout principal
   ========== */
.container {
  max-width: 1120px;
  margin: 24px auto 40px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* ==========
   Cards
   ========== */
.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
}

/* glow diferente para o top 3 */
.card.gold::before {
  background: linear-gradient(135deg, rgba(247, 156, 46, 0.6), rgba(251, 191, 36, 0.3));
}

.card.silver::before {
  background: linear-gradient(135deg, rgba(209, 213, 219, 0.8), rgba(148, 163, 184, 0.4));
}

.card.bronze::before {
  background: linear-gradient(135deg, rgba(248, 153, 112, 0.7), rgba(180, 83, 9, 0.25));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-title {
  font-weight: 600;
  font-size: 16px;
}

.card-subtitle {
  font-size: 13px;
  color: #64748b;
}

/* ==========
   Medalhas / posição
   ========== */
.badge-pos {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.badge-pos.gold {
  background: #FBBF24;
  color: #422006;
}

.badge-pos.silver {
  background: #E5E7EB;
  color: #111827;
}

.badge-pos.bronze {
  background: #FED7AA;
  color: #7C2D12;
}

/* ==========
   Linhas de informação
   ========== */
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #475569;
}

/* ==========
   Barra de progresso
   ========== */
.progress-wrapper {
  margin-top: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--idealize-teal-light), var(--idealize-teal-dark));
}

/* ==========
   Status chips
   ========== */
.status-chip {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: lowercase;
}

.status-ok {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.status-bad {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

/* ==========
   Rodapé
   ========== */
.footer {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  padding: 12px 0 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* ==========
   Responsividade pequena
   ========== */
@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: row;
  }

  h1 {
    font-size: 18px;
  }

  .container {
    margin-top: 16px;
  }
}
