@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --navy-900: #0f242c;
  --navy-800: #15303a;
  --navy-700: #1d3f4a;
  --navy-600: #2c5561;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --border: #e3e7e8;
  --text: #12222a;
  --muted: #667479;
  --brand: #0f242c;
  --brand-light: #2c5561;
  --accent: #cf9f3f;
  --gold: #d9a94b;
  --silver: #aab8bd;
  --bronze: #c98753;
  --ok: #1f8a4c;
  --warn: #b5860b;
  --danger: #c0392b;
  --radius: 12px;
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand-light); text-decoration: none; }

h1, h2, h3 { font-weight: 700; }

/* ---------- layout: sidebar + main ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  overflow-y: auto;
  z-index: 40;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 24px;
}

.sidebar-logo img { height: 30px; display: block; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b9c7cc;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.sidebar-nav a::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(217, 169, 75, 0.2), transparent 75%);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-nav a svg.ico { flex-shrink: 0; transition: transform 0.2s ease, filter 0.2s ease; }
.sidebar-nav a span { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; transform: translateX(4px); }
.sidebar-nav a:hover::before { transform: translateX(0); }
.sidebar-nav a:hover svg.ico { transform: scale(1.15); }
.sidebar-nav a:active { transform: translateX(4px) scale(0.96); }

.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(217, 169, 75, 0.16), rgba(255, 255, 255, 0.04));
  color: #fff;
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(217, 169, 75, 0.12);
  animation: navActiveIn 0.3s ease;
}
.sidebar-nav a.active svg.ico { color: var(--accent); filter: drop-shadow(0 0 5px rgba(217, 169, 75, 0.55)); }

@keyframes navActiveIn {
  from { background-position: -20px 0; opacity: 0.6; }
  to { opacity: 1; }
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 10px 8px;
}

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: #a9b7bc;
}

.sidebar-user .who-name { color: #fff; font-weight: 600; display: block; }

.sidebar-user button {
  width: 100%;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-user button:hover { background: rgba(255, 255, 255, 0.18); }

main {
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  width: 100%;
  animation: fadeIn 0.35s ease;
}

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

/* transição de saída ao trocar de página pelo menu lateral */
body { transition: opacity 0.16s ease; }
body.page-leaving { opacity: 0; }

/* transição ao trocar de aba (ex.: dashboard) */
.tab-anim { animation: tabEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes tabEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body, .tab-anim, main { animation: none !important; transition: none !important; }
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .sidebar-logo { padding: 4px 10px; }
  .sidebar-nav { flex-direction: row; flex: none; }
  .sidebar-nav a { padding: 9px 12px; white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .sidebar-divider { display: none; }
  .sidebar-user { border-top: none; margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
  .sidebar-user .who-name { display: none; }
  .sidebar-user button { width: auto; margin-top: 0; }
  main { margin-left: 0; }
}

/* ---------- page chrome ---------- */

.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.page-title h1 { font-size: 1.5rem; margin: 0; color: var(--navy-900); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

/* sem transform aqui de propósito: transform cria um novo contexto de
   empilhamento no card, e isso prendia o menu de filtro (.ms-menu) atrás
   de outros elementos da página (ex.: as sub-abas do dashboard) */
.card:hover { box-shadow: 0 12px 30px rgba(15, 36, 44, 0.1); border-color: #d7dde0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.kpi:hover { box-shadow: 0 12px 28px rgba(15, 36, 44, 0.1); transform: translateY(-3px); border-color: #d7dde0; }

.kpi .label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.kpi .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-top: 4px;
  transition: color 0.2s ease;
}

.kpi:hover .value { color: var(--brand-light); }

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

.chart-wrap { position: relative; height: 280px; }

/* ---------- sub-tabs (dashboard sections) ---------- */

.subtabs {
  position: relative;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.subtabs button {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 4px;
  margin-right: 18px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, transform 0.15s ease;
}

.subtabs button::after { display: none; }
.subtabs button:hover { background: transparent; color: var(--navy-900); transform: translateY(-1px); box-shadow: none; }
.subtabs button:active { transform: translateY(0) scale(0.97); }

.subtabs button.active { color: var(--navy-900); border-bottom-color: transparent; }

.subtabs-indicator {
  position: absolute;
  bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--navy-600));
  border-radius: 2px;
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(217, 169, 75, 0.6);
}

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.02em; }

.col-cliente { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.col-construtora { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--navy-900); }
th.sortable .sort-arrow { display: inline-block; margin-left: 4px; opacity: 0.4; }
th.sortable.sort-active .sort-arrow { opacity: 1; }

tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: #f7f9f9; }

.table-wrap { overflow-x: auto; }

/* ---------- forms ---------- */

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

.filtros-datas-panel {
  background: #fafbfb;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 16px 6px;
  margin-top: -4px;
  align-items: flex-start;
  box-shadow: 0 8px 20px rgba(15, 36, 44, 0.06);
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(44, 85, 97, 0.14);
}

/* inputs de data ficam feios no padrão do navegador — retoca o ícone do
   calendário pra combinar com a marca em vez do cinza-padrão */
input[type='date'] { cursor: pointer; color-scheme: light; }

input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 3px;
  margin-right: -2px;
  border-radius: 6px;
  filter: invert(14%) sepia(20%) saturate(1200%) hue-rotate(155deg) brightness(95%);
  transition: filter 0.15s ease, background 0.15s ease;
}
input[type='date']:hover::-webkit-calendar-picker-indicator { background: rgba(15, 36, 44, 0.08); }
input[type='date']:focus::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(46%) saturate(500%) hue-rotate(358deg) brightness(95%) contrast(92%);
}

label { font-size: 0.82rem; color: var(--muted); display: block; margin-bottom: 3px; }

.field { margin-bottom: 10px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 14px;
}

button, .btn {
  position: relative;
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--navy-900);
  color: #fff;
  overflow: hidden;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}

button::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
button:hover::after { left: 130%; }

button:hover {
  background: var(--navy-700);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 36, 44, 0.28);
}
button:active { transform: translateY(0) scale(0.97); }
button.secondary { background: #eceff0; color: var(--text); }
button.secondary:hover { background: #e2e6e7; box-shadow: 0 8px 18px rgba(15, 36, 44, 0.1); }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: #a83226; box-shadow: 0 8px 20px rgba(192, 57, 43, 0.35); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
button:disabled::after { display: none; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge.RESERVADA { background: #eef1f1; color: #4b5760; }
.badge.GIRET { background: #fdf1dc; color: var(--warn); }
.badge.CONFORMIDADE { background: #e3ecee; color: var(--brand-light); }
.badge.ASSINOU-CONTRATO { background: #ece3f7; color: #5b3fa0; }
.badge.VENDIDA { background: #e3f4e9; color: var(--ok); }
.badge.CANCELADA { background: #fbe6e4; color: var(--danger); }
.badge.FALTA-CLIENTE { background: #e6eef7; color: #3b5f8a; }

.ms { position: relative; display: inline-block; }

.ms-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  text-align: left;
  min-width: 150px;
}

.ms-btn:hover { background: #fff; transform: none; }

.ms-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 25;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 36, 44, 0.14);
  padding: 8px;
  min-width: 210px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 30;
}

.ms-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.ms-opt:hover { background: #f4f4f4; }
.ms-opt input { margin: 0; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #dfe6e8;
  vertical-align: middle;
  flex-shrink: 0;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.avatar-upload img.preview {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #eceff0;
  border: 1px solid var(--border);
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 16, 20, 0.58);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 50;
  animation: fadeIn 0.15s ease;
}

.modal {
  position: relative;
  background: #fff; border-radius: 16px; padding: 26px 24px 22px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  animation: cardEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--navy-600));
}

.modal h2 { margin-top: 0; font-size: 1.2rem; color: var(--navy-900); }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.form-section-title {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-light);
  margin: 12px 0 -4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.form-section-title.first { margin-top: 0; padding-top: 0; border-top: none; }

input[type='checkbox'] {
  accent-color: var(--accent);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { animation: none; }
}

.muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- login ---------- */

.login-wrap {
  position: relative;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #1c3e49 0%, var(--navy-900) 55%, #060f13 100%);
  padding: 20px;
  overflow: hidden;
}

/* textura de pontos, igual ao site institucional */
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 40%, #000 30%, transparent 78%);
  animation: gridDrift 40s linear infinite;
}

/* marca d'água enorme da logo atrás do card */
.login-wrap::after {
  content: '';
  position: absolute;
  right: -12%; bottom: -18%;
  width: min(1100px, 130vw); height: min(1100px, 130vw);
  background: url('logo-mark-white.png') center / contain no-repeat;
  opacity: 0.05;
  transform: rotate(-8deg);
  pointer-events: none;
}

.login-blob {
  position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
}
.login-blob.b1 {
  width: 480px; height: 480px; top: -140px; left: -120px;
  background: radial-gradient(circle, rgba(217, 169, 75, 0.35), transparent 70%);
  animation: blobFloat 16s ease-in-out infinite;
}
.login-blob.b2 {
  width: 420px; height: 420px; bottom: -160px; right: -100px;
  background: radial-gradient(circle, rgba(44, 85, 97, 0.55), transparent 70%);
  animation: blobFloat 20s ease-in-out infinite reverse;
}
.login-blob.b3 {
  width: 260px; height: 260px; top: 55%; left: 8%;
  background: radial-gradient(circle, rgba(217, 169, 75, 0.18), transparent 70%);
  animation: blobFloat 24s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.12); }
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to { background-position: 260px 260px; }
}

.login-tagline {
  position: absolute;
  left: 7%; bottom: 9%;
  max-width: 460px;
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  z-index: 1;
  pointer-events: none;
  animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s backwards;
}
.login-tagline .accent {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(217, 169, 75, 0.55);
}

@media (max-width: 860px) {
  .login-tagline { display: none; }
}

.login-card {
  position: relative; z-index: 1;
  background: #fff; border-radius: 18px; padding: 40px 34px 34px; width: 100%; max-width: 390px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: cardEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--navy-600), var(--accent));
  background-size: 200% 100%;
  animation: sheenBar 5s linear infinite;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sheenBar {
  from { background-position: 0% 0; }
  to { background-position: 200% 0; }
}

.login-card .login-logo {
  display: block; height: 42px; margin: 4px 0 22px;
  animation: fadeIn 0.5s ease 0.15s backwards;
}
.login-card h1 { margin: 0 0 4px; font-size: 1.35rem; color: var(--navy-900); }
.login-card p.sub {
  margin: 0 0 24px; color: var(--muted); font-size: 0.88rem;
  animation: fadeIn 0.5s ease 0.22s backwards;
}
.login-card .field {
  margin-bottom: 16px;
  animation: fadeIn 0.5s ease backwards;
}
.login-card .field:nth-of-type(1) { animation-delay: 0.28s; }
.login-card .field:nth-of-type(2) { animation-delay: 0.34s; }
.login-card input { width: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
.login-card input:focus { box-shadow: 0 0 0 3px rgba(217, 169, 75, 0.25); border-color: var(--accent); }
.login-card button {
  width: 100%; margin-top: 8px; padding: 13px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-600));
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  animation: fadeIn 0.5s ease 0.4s backwards;
}
.login-card button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 36, 44, 0.35);
  filter: brightness(1.08);
}
.login-card button:disabled { opacity: 0.7; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .login-wrap::before, .login-blob, .login-card::before, .login-tagline { animation: none; }
  .login-card, .login-card .login-logo, .login-card p.sub, .login-card .field, .login-card button {
    animation: none;
  }
}

.alert { padding: 10px 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 12px; }
.alert.error { background: #fbe6e4; color: var(--danger); }
.alert.ok { background: #e3f4e9; color: var(--ok); }

[hidden] { display: none !important; }

/* ================= TV boards ================= */

.tv-shell {
  background: linear-gradient(160deg, #eef2f2 0%, #e2eaec 100%);
  min-height: 100vh;
  padding: 26px;
}

.tv-header {
  background: var(--navy-900);
  color: #fff;
  border-radius: 18px;
  padding: 18px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.tv-header .brand-block { display: flex; align-items: center; gap: 16px; }
.tv-header .brand-block img { height: 40px; }
.tv-header .titles .kicker {
  font-size: 0.72rem; letter-spacing: 0.08em; color: #93a7ad;
  font-weight: 600; text-transform: uppercase;
}
.tv-header .titles h1 { margin: 3px 0 0; font-size: 1.55rem; }

.tv-header .right { display: flex; align-items: center; gap: 18px; }

.tv-header .meta { text-align: right; font-size: 0.76rem; color: #93a7ad; }
.tv-header .meta strong { color: #fff; font-size: 0.95rem; display: block; }

.tv-month-picker select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}

.tv-grid {
  display: grid;
  grid-template-columns: 3fr 1.2fr;
  gap: 20px;
  align-items: start;
}

.tv-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.podium-card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 16px 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 3px 14px rgba(15, 36, 44, 0.08);
  transition: transform 0.2s ease;
}

.podium-card.rank-1 {
  background: linear-gradient(165deg, #fdf3dd, #f8dfa0);
  transform: translateY(-14px);
  box-shadow: 0 14px 34px rgba(201, 159, 63, 0.3);
}

.podium-card.rank-3 { background: linear-gradient(165deg, #fdece7, #fad3c4); }

.tv-podium.of5 {
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: end;
}
.tv-podium.of5 .podium-card { padding: 20px 8px 16px; transition: transform 0.2s ease; }
.tv-podium.of5 .podium-avatar { width: 56px; height: 56px; font-size: 1rem; margin-bottom: 10px; }
.tv-podium.of5 .podium-name { font-size: 0.82rem; }
.tv-podium.of5 .podium-value { font-size: 1.3rem; }
.tv-podium.of5 .podium-value .unit { display: block; margin-left: 0; }

.tv-podium.of5 .p5-1 { order: 3; transform: translateY(-16px); padding: 26px 10px 20px; z-index: 2; box-shadow: 0 16px 34px rgba(15, 36, 44, 0.22); }
.tv-podium.of5 .p5-1 .podium-avatar { width: 76px; height: 76px; font-size: 1.3rem; }
.tv-podium.of5 .p5-1 .podium-name { font-size: 0.95rem; }
.tv-podium.of5 .p5-1 .podium-value { font-size: 1.7rem; }

.tv-podium.of5 .p5-2 { order: 2; transform: translateY(-4px); }
.tv-podium.of5 .p5-3 { order: 4; transform: translateY(-4px); }
.tv-podium.of5 .p5-4 { order: 1; }
.tv-podium.of5 .p5-5 { order: 5; }

@media (max-width: 760px) {
  .tv-podium.of5 { grid-template-columns: repeat(2, 1fr); align-items: stretch; }
  .tv-podium.of5 .p5-1, .tv-podium.of5 .p5-2, .tv-podium.of5 .p5-3, .tv-podium.of5 .p5-4, .tv-podium.of5 .p5-5 {
    order: initial; transform: none;
  }
}

.equipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.podium-card.tier-green { background: linear-gradient(165deg, #e3f4e9, #c3e8d1); }
.podium-card.tier-yellow { background: linear-gradient(165deg, #fdf3dd, #f8dfa0); }
.podium-card.tier-red { background: linear-gradient(165deg, #fdece7, #f6c3b7); }

.podium-rank-chip {
  position: absolute; top: 10px; left: 12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(15, 36, 44, 0.12); color: var(--navy-900);
  font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.podium-crown {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-size: 1.7rem;
}

.podium-medal { position: absolute; top: 12px; left: 16px; font-size: 1.3rem; }

.podium-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  margin: 4px auto 14px; border: 4px solid #fff; background: #dfe6e8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  display: block;
}

.podium-card.rank-1 .podium-avatar { width: 112px; height: 112px; }

.podium-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; color: var(--navy-900); }

.podium-value { font-size: 2.1rem; font-weight: 800; color: var(--navy-900); }
.podium-value .unit {
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; margin-left: 4px; letter-spacing: 0.02em;
}

.tv-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.tv-row {
  display: flex; align-items: center; gap: 10px;
  background: #fdeceb; border-radius: 12px; padding: 9px 12px;
  transition: transform 0.12s ease;
}

.tv-row .rank {
  width: 26px; height: 26px; border-radius: 50%; background: var(--danger);
  color: #fff; font-size: 0.76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.tv-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #dfe6e8; flex-shrink: 0; }

.tv-row .info { flex: 1; min-width: 0; }
.tv-row .info .name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-row .info .tag { font-size: 0.63rem; color: #b0554a; text-transform: uppercase; letter-spacing: 0.03em; }
.tv-row .count { font-weight: 700; color: var(--navy-900); }

.tv-side { background: var(--navy-900); color: #fff; border-radius: 18px; padding: 20px; }
.tv-side .kicker { font-size: 0.68rem; color: #93a7ad; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.tv-side h3 { margin: 2px 0 14px; font-size: 1.05rem; }

.tv-side-list { display: flex; flex-direction: column; gap: 5px; max-height: 74vh; overflow-y: auto; }

.tv-side-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.tv-side-row:hover { background: rgba(255, 255, 255, 0.06); }
.tv-side-row .rank {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.12);
  font-size: 0.66rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tv-side-row img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #2a4550; flex-shrink: 0; }
.tv-side-row .name { flex: 1; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-side-row .val { font-size: 0.8rem; font-weight: 700; color: var(--accent); }

.tv-footnote { margin-top: 16px; font-size: 0.72rem; color: #7c8c91; text-align: center; }

.tv-back {
  display: inline-block; margin-bottom: 14px; font-size: 0.82rem; color: var(--navy-900);
  background: #fff; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
}

@media (max-width: 980px) {
  .tv-grid { grid-template-columns: 1fr; }
  .tv-podium { grid-template-columns: 1fr; }
  .podium-card.rank-1 { transform: none; order: -1; }
  .tv-list { grid-template-columns: 1fr; }
}

