/* ===========================================================================
 * Onze Performance Xavante — Demo estático (Grêmio Esportivo Brasil)
 * Brandbook rubro-negro. Sem framework, 100% responsivo.
 * ========================================================================= */
:root {
  --preto: #0b0b0b;
  --grafite: #161616;
  --grafite-2: #1c1c1c;
  --vinho: #3a0d16;
  --vinho-2: #6b0f1a;
  --rubro: #c8102e;
  --rubro-claro: #e23048;
  --branco: #ffffff;
  --cinza: #a1a1aa;
  --cinza-2: #71717a;
  --borda: #27272a;
  --ok: #35b57e;
  --warn: #e0a32e;
  --err: #e23b3b;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--preto);
  color: #fafafa;
  line-height: 1.5;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---- Escudo transparente (PNG sem fundo) ---- */
.crest { display: inline-flex; align-items: center; justify-content: center; }
.crest img { height: 40px; width: auto; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55)); }
.crest.sm img { height: 30px; }
.crest.lg img { height: 72px; }

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--rubro); color: #fff; font-weight: 600; font-size: 14px;
  border: none; border-radius: 10px; padding: 12px 20px; cursor: pointer;
  transition: background .15s ease, transform .05s ease; width: 100%;
}
.btn:hover { background: var(--rubro-claro); }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* ---- Inputs ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; color: var(--cinza); margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; background: var(--grafite-2); border: 1px solid var(--borda);
  color: #fafafa; border-radius: 10px; padding: 13px 14px; font-size: 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { box-shadow: 0 0 0 3px rgba(200,16,46,.18); }
.field input:focus { border-color: var(--rubro); }
.field input::placeholder { color: var(--cinza-2); }

/* ---- Cards ---- */
.card {
  background: var(--grafite); border: 1px solid var(--borda);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }

/* ---- Pílulas / badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pill.rubro { background: rgba(200,16,46,.16); color: #ff6178; }
.pill.ok { background: rgba(53,181,126,.15); color: var(--ok); }
.pill.warn { background: rgba(224,163,46,.15); color: var(--warn); }
.pill.err { background: rgba(226,59,59,.15); color: #ff7a7a; }
.pill.cinza { background: rgba(255,255,255,.07); color: var(--cinza); }

.tag {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 6px;
}

/* ---- Section title com barra rubra ---- */
.section-head { display: flex; align-items: center; gap: 12px; border-left: 3px solid var(--rubro); padding-left: 12px; margin: 4px 0 4px; }
.section-head .kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ff6178; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.section-head .ico { color: var(--rubro); }

/* ---- Grids ---- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Stat tile ---- */
.stat { position: relative; }
.stat .lbl { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--cinza); }
.stat .val { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.05; margin-top: 4px; }
.stat .hint { font-size: 11px; color: var(--cinza-2); margin-top: 8px; }
.stat .badge-ico { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.t-brand { background: rgba(200,16,46,.12); color: var(--rubro); }
.t-ok { background: rgba(53,181,126,.12); color: var(--ok); }
.t-warn { background: rgba(224,163,46,.12); color: var(--warn); }
.t-err { background: rgba(226,59,59,.12); color: #ff7a7a; }

/* ---- Ranking ---- */
.rank-row { display: block; padding: 8px; border-radius: 8px; transition: background .12s; }
.rank-row:hover { background: rgba(255,255,255,.03); }
.rank-line { display: flex; align-items: center; gap: 10px; }
.rank-pos { width: 20px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--cinza); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-pos.first { background: var(--rubro); color: #fff; }
.avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--vinho); color: #ff9fae; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-name { flex: 1; min-width: 0; }
.rank-name b { font-size: 14px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name span { font-size: 11px; color: var(--cinza); }
.rank-val { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--rubro-claro); }
.rank-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); margin: 6px 0 0 30px; overflow: hidden; }
.rank-bar > div { height: 100%; background: var(--rubro); }

/* ---- Score badge ---- */
.score { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-weight: 700; font-size: 14px; padding: 4px 9px; border-radius: 8px; }
.score.hi { background: rgba(53,181,126,.15); color: var(--ok); }
.score.mid { background: rgba(200,16,46,.15); color: #ff6178; }
.score .k { font-family: "Inter", sans-serif; font-size: 10px; opacity: .7; text-transform: uppercase; }

/* ---- Tabela ---- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 11px; color: var(--cinza); font-weight: 500; padding: 12px; border-bottom: 1px solid var(--borda); }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--borda); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl .r { text-align: right; }
.trend-up { color: var(--ok); font-weight: 600; font-size: 13px; }
.trend-down { color: #ff7a7a; font-weight: 600; font-size: 13px; }

/* ---- Insight card ---- */
.insight { border: 1px solid var(--borda); border-radius: var(--radius); padding: 16px; }
.insight.info { border-color: rgba(53,181,126,.35); background: rgba(53,181,126,.05); }
.insight.crit { border-color: rgba(226,59,59,.4); background: rgba(226,59,59,.05); }
.insight.att { border-color: rgba(224,163,46,.35); background: rgba(224,163,46,.05); }
.insight .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.insight h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.insight p { font-size: 12px; color: var(--cinza); }
.insight .rec { background: rgba(255,255,255,.04); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-top: 8px; color: #e4e4e7; }
.insight .rec b { color: #fff; }
.insight .who { font-size: 12px; font-weight: 600; color: #ff6178; }

/* ---- Bars (carga) ---- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 128px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bars .num { font-family: var(--mono); font-size: 10px; color: var(--cinza); }
.bars .bar { width: 100%; border-radius: 6px 6px 0 0; background: var(--rubro); }
.bars .bar.over { background: var(--err); }
.bars .lb { font-size: 10px; color: var(--cinza); }

/* ---- Med tile ---- */
.med { border: 1px solid var(--borda); border-radius: 10px; padding: 12px; }
.med .n { font-size: 12px; color: var(--cinza); }
.med .r { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.med .r span { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Donut legend ---- */
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.legend .row { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .row b { font-family: var(--mono); }
.legend .row span { color: var(--cinza); margin-left: auto; }

/* ===========================================================================
 * LOGIN (index.html)
 * ========================================================================= */
.login { display: grid; grid-template-columns: 1.08fr 1fr; height: 100vh; overflow: hidden; }
.login-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: clamp(24px, 3.2vh, 48px) clamp(32px, 3.6vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between; gap: clamp(14px, 2vh, 30px);
  border-right: 1px solid rgba(200, 16, 46, .28);
  background:
    radial-gradient(1100px 520px at 12% -5%, rgba(200,16,46,.20) 0%, transparent 55%),
    linear-gradient(135deg, #0b0b0b 0%, #141414 52%, #1c0d11 100%);
}
/* Textura de listras rubro-negras (camisa do clube), bem sutil */
.login-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(114deg, rgba(200,16,46,.055) 0 3px, transparent 3px 36px);
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 78%);
  mask-image: linear-gradient(100deg, #000 0%, transparent 78%);
}
/* Escudo como marca-d'água de fundo */
.brand-watermark {
  position: absolute; right: 4%; top: 50%; height: min(74vh, 560px); width: auto;
  opacity: .07; pointer-events: none; transform: translateY(-50%) rotate(-6deg);
  filter: drop-shadow(0 0 30px rgba(0,0,0,.6));
}
.login-brand .field-motif { position: absolute; inset: 0; opacity: .05; pointer-events: none; }
.login-brand .field-motif .vline { position: absolute; left: 62%; top: 0; height: 100%; width: 1px; background: #fff; }
.login-brand .field-motif .circle { position: absolute; left: 62%; top: 50%; width: 300px; height: 300px; border: 1px solid #fff; border-radius: 999px; transform: translate(-50%,-50%); }
.login-brand .glow { position: absolute; left: -80px; top: -60px; width: 320px; height: 320px; border-radius: 999px; background: rgba(200,16,46,.30); filter: blur(80px); }

.brand-top { position: relative; display: flex; align-items: center; gap: 16px; }
.brand-top .pn { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand-top .sub { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-top: 3px; }
.brand-mid { position: relative; max-width: 500px; }
.brand-mid h1 { font-size: clamp(24px, 3vw, 33px); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; }
.brand-mid > p { margin-top: clamp(10px, 1.4vh, 16px); font-size: 13.5px; line-height: 1.55; color: rgba(255,255,255,.68); }
.feat { list-style: none; margin-top: clamp(16px, 2.2vh, 30px); display: flex; flex-direction: column; gap: clamp(9px, 1.5vh, 16px); }
.feat li { display: flex; gap: 12px; align-items: flex-start; }
.feat .fi { width: 34px; height: 34px; border-radius: 9px; background: rgba(200,16,46,.16); border: 1px solid rgba(200,16,46,.25); color: #ff5069; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.feat b { font-size: 14px; font-weight: 600; display: block; }
.feat span { font-size: 12.5px; color: rgba(255,255,255,.55); }
.brand-stats { position: relative; display: flex; gap: 28px; margin-top: clamp(14px, 2vh, 28px); padding-top: clamp(12px, 1.6vh, 20px); border-top: 1px solid rgba(255,255,255,.09); flex-wrap: wrap; }
.brand-stats b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-stats span { font-size: 11px; color: rgba(255,255,255,.5); }
.brand-foot { position: relative; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.38); }

.login-form { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 4vh, 48px) clamp(24px, 3vw, 40px); overflow: auto; }
.login-form .inner { width: 100%; max-width: 404px; }
.login-form .mobile-crest { display: none; justify-content: center; margin-bottom: 24px; }
.login-form h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.login-form .lead { font-size: 14px; color: var(--cinza); margin: 8px 0 28px; }
.login-form .login-card { padding: 28px; }
.login-form .login-card .field:last-of-type { margin-bottom: 22px; }
.login-form .foot { text-align: center; font-size: 12px; color: var(--cinza-2); margin-top: 24px; }
.demo-tag { position: fixed; top: 14px; right: 14px; z-index: 5; background: rgba(200,16,46,.14); border: 1px solid rgba(200,16,46,.3); color: #ff8195; font-size: 11px; padding: 5px 12px; border-radius: 999px; }

/* ===========================================================================
 * APP SHELL (painel.html)
 * ========================================================================= */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--grafite); border-right: 1px solid var(--borda);
  display: flex; flex-direction: column; height: 100vh;
}
.sidebar .brand { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--borda); }
.sidebar .brand b { font-size: 15px; font-weight: 700; }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav .group { margin-bottom: 18px; }
.nav .group > p { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--cinza-2); padding: 0 8px; margin-bottom: 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #d4d4d8; transition: background .12s, color .12s; }
.nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.nav a.active { background: rgba(200,16,46,.14); color: #ff6178; }
.nav a.active .ico { color: var(--rubro); }
.nav a .ico { color: var(--cinza); flex-shrink: 0; }
.nav a .count { margin-left: auto; font-size: 10px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--cinza); padding: 1px 7px; border-radius: 6px; }
.nav a.active .count { background: var(--rubro); color: #fff; }
.side-foot { border-top: 1px solid var(--borda); padding: 12px 16px; font-size: 11px; color: var(--cinza); }
.side-foot b { color: #e4e4e7; display: block; font-weight: 600; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--borda); background: var(--grafite); }
.topbar .search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--grafite-2); border: 1px solid var(--borda); border-radius: 9px; padding: 8px 12px; color: var(--cinza-2); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .ic-btn { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--cinza); }
.topbar .me { width: 32px; height: 32px; border-radius: 999px; background: var(--vinho); color: #ff9fae; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.hamb { display: none; width: 34px; height: 34px; border: none; background: transparent; color: #fff; border-radius: 8px; cursor: pointer; align-items: center; justify-content: center; }
.topbar .crest.mtop { display: none; }
.content { flex: 1; overflow-y: auto; }
.content .wrap { max-width: 1120px; margin: 0 auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 28px; }
.demo-banner { border: 1px solid rgba(200,16,46,.3); background: rgba(200,16,46,.08); color: #ff8195; text-align: center; font-size: 12px; padding: 8px; border-radius: 8px; }
.foot-note { text-align: center; font-size: 12px; color: var(--cinza-2); }
.disclaimer { font-size: 11px; color: var(--cinza-2); margin-top: 4px; display: flex; gap: 6px; align-items: center; }

.radar-wrap { display: flex; flex-direction: column; align-items: center; }
.badges-row { display: flex; gap: 8px; margin-top: 10px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }

/* ===========================================================================
 * RESPONSIVO
 * ========================================================================= */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* ---- LOGIN mobile: marca no topo (bonita como no PC) + form embaixo ---- */
  .login { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: auto; }
  .login-brand {
    display: flex; gap: 16px; padding: 38px 24px 30px;
    border-right: none; border-bottom: 1px solid rgba(200, 16, 46, .3);
  }
  .login-brand .feat, .login-brand .brand-stats, .login-brand .brand-foot,
  .login-brand .field-motif { display: none; }
  .brand-watermark { height: 240px; right: -24px; top: auto; bottom: -30px; opacity: .09; transform: rotate(-6deg); }
  .brand-top .pn { font-size: 17px; }
  .brand-mid { max-width: none; }
  .brand-mid h1 { font-size: 27px; }
  .brand-mid > p { font-size: 13px; margin-top: 12px; }
  .login-form { padding: 30px 24px 46px; }
  .login-form .inner { max-width: 460px; }
  .login-form .mobile-crest { display: none; }

  /* ---- App shell mobile ---- */
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.6);
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .hamb { display: flex; }
  .topbar .crest.mtop { display: inline-flex; }
  .topbar .search, .topbar .ic-btn { display: none; } /* declutter no mobile */
  .content .wrap { padding: 16px 14px; gap: 22px; }
  .section-head h2 { font-size: 18px; }

  /* Grids: 2 colunas de stat, 1 coluna pro resto */
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr; } /* telas bem pequenas: tudo empilhado */
  .brand-mid h1 { font-size: 25px; }
  .topbar { gap: 8px; }
}
