:root {
  --sidebar-bg: #1a2e1a;
  --sidebar-text: #c8e6c9;
  --sidebar-active: #4caf50;
  --primary: #2e7d32;
  --primary-light: #43a047;
  --accent: #66bb6a;
  --bg: #f1f8f1;
  --card-bg: #ffffff;
  --text: #1b2e1b;
  --muted: #6c757d;
  --danger: #c62828;
  --warning: #e65100;
}

* { box-sizing: border-box; }

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

/* ─── LAYOUT ─────────────────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.4rem 1.2rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  line-height: 1.3;
}

.sidebar-brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--accent);
  margin-top: 2px;
}

.sidebar nav { flex: 1; padding: 0.8rem 0; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1.2rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(76,175,80,0.15);
  color: #fff;
  border-left-color: var(--sidebar-active);
}

.sidebar nav .nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(200,230,201,0.5);
  padding: 1rem 1.2rem 0.3rem;
}

.sidebar-study {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: .8rem 1rem;
}

.sidebar-study-header {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(200,230,201,.6);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.sidebar-online-count {
  background: #4caf50;
  color: #fff;
  border-radius: 20px;
  font-size: .6rem;
  padding: .05rem .4rem;
  font-weight: 700;
}

.sidebar-chibi-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.sidebar-chibi-item {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.sidebar-chibi-item img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
  border: 1.5px solid rgba(76,175,80,.4);
}

.sidebar-chibi-item span {
  font-size: .78rem;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-study-empty {
  font-size: .72rem;
  color: rgba(200,230,201,.4);
  font-style: italic;
}

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(200,230,201,0.7);
}

.sidebar-footer a {
  color: #ef9a9a;
  text-decoration: none;
}
.sidebar-footer a:hover { color: #fff; }

.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 2rem;
  max-width: calc(100vw - 240px);
}

/* ─── TOPBAR ─────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.topbar h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* ─── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.card-value.danger { color: var(--danger); }
.card-value.warning { color: var(--warning); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ─── TABELA ─────────────────────────────────────────── */
.table-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-card-header {
  padding: 1rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

thead th {
  background: #e8f5e9;
  color: var(--primary);
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-align: left;
}

tbody tr { border-bottom: 1px solid #f0f4f0; }
tbody tr:hover { background: #f9fbf9; }
tbody td { padding: 0.7rem 1rem; vertical-align: middle; }

/* ─── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-red { background: #ffebee; color: #c62828; }
.badge-yellow { background: #fff8e1; color: #e65100; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-gray { background: #f5f5f5; color: #555; }

/* ─── BOTÕES ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.1rem;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: #388e3c; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: #e65100; color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

/* ─── FORMULÁRIOS ────────────────────────────────────── */
.form-card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 1.8rem;
  max-width: 680px;
}

.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid #c8e6c9;
  border-radius: 7px;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(67,160,71,0.12);
}

textarea { resize: vertical; min-height: 80px; }

/* ─── ALERTAS ────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 3px solid #4caf50; }
.alert-danger { background: #ffebee; color: #c62828; border-left: 3px solid #ef5350; }
.alert-warning { background: #fff8e1; color: #e65100; border-left: 3px solid #ffa726; }
.alert-info { background: #e3f2fd; color: #1565c0; border-left: 3px solid #42a5f5; }

/* ─── BARRA DE PROGRESSO ─────────────────────────────── */
.progress-bar-wrap {
  background: #e8f5e9;
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* ─── LEADERBOARD ────────────────────────────────────── */
.rank-medal { font-size: 1.2rem; }
.rank-1 .rank-medal::before { content: "🥇"; }
.rank-2 .rank-medal::before { content: "🥈"; }
.rank-3 .rank-medal::before { content: "🥉"; }
.rank-other .rank-medal::before { content: ""; }

/* ─── REVIEW CARD ────────────────────────────────────── */
.review-container {
  max-width: 700px;
  margin: 0 auto;
}

.review-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.review-card .pergunta {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1rem;
}

.review-card .topico-badge {
  display: inline-block;
  background: #e8f5e9;
  color: var(--primary);
  border-radius: 20px;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.review-card .gabarito {
  background: #f1f8f1;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.2rem 1.5rem;
  text-align: left;
  margin: 1.2rem 0;
  font-size: 1rem;
  line-height: 1.7;
}

.nota-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.nota-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  min-width: 62px;
  transition: all 0.15s;
  background: #f5f5f5;
}

.nota-btn span { font-size: 0.62rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.nota-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.nota-0 { color: #b71c1c; } .nota-0:hover { background: #ffebee; border-color: #ef5350; }
.nota-1 { color: #c62828; } .nota-1:hover { background: #ffebee; border-color: #ef9a9a; }
.nota-2 { color: #e65100; } .nota-2:hover { background: #fff3e0; border-color: #ffa726; }
.nota-3 { color: #f9a825; } .nota-3:hover { background: #fff8e1; border-color: #ffcc02; }
.nota-4 { color: #388e3c; } .nota-4:hover { background: #e8f5e9; border-color: #66bb6a; }
.nota-5 { color: #1b5e20; } .nota-5:hover { background: #e8f5e9; border-color: #2e7d32; }

/* ─── LACUNAS (CLOZE) ────────────────────────────────── */
.lacunas-texto {
  font-size: 1.05rem;
  line-height: 2.4;
  text-align: left;
  padding: .5rem 0;
}

.lac-input {
  border: none;
  border-bottom: 2.5px solid var(--primary);
  background: transparent;
  width: 130px;
  font-size: 1rem;
  text-align: center;
  outline: none;
  padding: 0 6px 2px;
  margin: 0 4px;
  color: var(--text);
  transition: border-color .15s;
}

.lac-input:focus {
  border-bottom-color: var(--accent);
  background: #f1f8f1;
  border-radius: 4px 4px 0 0;
}

.lac-input::placeholder { color: #bbb; font-style: italic; }

/* ─── ALTERNATIVAS ───────────────────────────────────── */
.alternativas-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1.2rem;
  text-align: left;
}

.alt-btn {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  border: 2px solid #c8e6c9;
  background: #fff;
  cursor: pointer;
  width: 100%;
  font-size: .95rem;
  transition: all .15s;
  text-align: left;
  color: var(--text);
}

.alt-btn:hover {
  border-color: var(--primary-light);
  background: #f1f8f1;
  transform: translateX(3px);
}

.alt-letra {
  font-weight: 700;
  color: var(--primary);
  background: #e8f5e9;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .88rem;
}

.alt-correta {
  border-color: #4caf50 !important;
  background: #e8f5e9 !important;
}

.alt-correta .alt-letra {
  background: #4caf50;
  color: #fff;
}

.alt-errada {
  border-color: #ef5350 !important;
  background: #ffebee !important;
}

.alt-errada .alt-letra {
  background: #ef5350;
  color: #fff;
}

/* ─── LOGIN ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2e1a 0%, #2e7d32 100%);
}

.login-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo h1 {
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
}

.login-logo p {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

/* ─── INATIVOS ALERT ─────────────────────────────────── */
.inativo-row { background: #fff8f8 !important; }
.inativo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef5350;
  display: inline-block;
  margin-right: 4px;
}

/* ─── SALA DE AULA VISUAL ────────────────────────────── */
.sala-aula {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #8b6340;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  background: url('/static/classroom.png') center 45% / cover no-repeat;
  height: 420px;
}

/* overlay escuro no topo para o header legível */
.sala-aula::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(180deg, rgba(0,0,0,0.52) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* overlay gradiente no rodapé para nomes legíveis */
.sala-aula::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(0deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
  pointer-events: none;
}

.sala-aula-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0 1.6rem 1.2rem;
}

.sala-aula-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  z-index: 3;
}

.sala-aula-titulo {
  font-weight: 700;
  font-size: .88rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: .04em;
  font-style: italic;
}

.sala-online-badge {
  background: #4caf50;
  color: #fff;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .55rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.sala-extra-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 20px;
  font-size: .65rem;
  font-weight: 700;
  padding: .12rem .45rem;
  border: 1px solid rgba(255,255,255,0.4);
}

/* parede — linha divisória */
.sala-parede-linha {
  height: 3px;
  background: linear-gradient(90deg, #b8895a, #d4a76a, #b8895a);
  margin: 0 -1.6rem 1.2rem;
}

.sala-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: .4rem .6rem;
  align-items: flex-end;
}

.sala-parede-linha { display: none; }

/* ── CARTEIRA ── */
.carteira {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  animation: carteira-bob 2.8s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}

@keyframes carteira-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* encosto da cadeira */
.cadeira-encosto {
  width: 42px;
  height: 18px;
  background: linear-gradient(180deg, #7a5230 0%, #5c3d1e 100%);
  border-radius: 5px 5px 0 0;
  border: 1.5px solid #3d2810;
  border-bottom: none;
  margin-bottom: -2px;
  position: relative;
  z-index: 0;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}

/* dois pinos decorativos no encosto */
.cadeira-encosto::before,
.cadeira-encosto::after {
  content: '';
  position: absolute;
  top: 5px;
  width: 4px; height: 10px;
  background: #3d2810;
  border-radius: 2px;
}
.cadeira-encosto::before { left: 10px; }
.cadeira-encosto::after  { right: 10px; }

.carteira-avatar-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
}

.carteira-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: block;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.carteira-online-dot {
  width: 11px; height: 11px;
  background: #4caf50;
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  bottom: 1px; right: -2px;
  box-shadow: 0 0 4px #4caf50;
}

/* assento da cadeira */
.cadeira-assento {
  width: 48px;
  height: 7px;
  background: linear-gradient(180deg, #8b6340 0%, #6b4c2a 100%);
  border-radius: 3px;
  border: 1px solid #3d2810;
  margin-bottom: 0;
  box-shadow: 0 2px 0 #3d2810;
}

/* mesa */
.carteira-mesa {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carteira-mesa-surface {
  width: 64px;
  height: 11px;
  background: linear-gradient(180deg, #e8c47a 0%, #c9a055 50%, #b8895a 100%);
  border-radius: 4px 4px 0 0;
  border: 1px solid #8b6340;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.4),
    2px 0 0 #8b6340,
    -2px 0 0 #8b6340;
  position: relative;
}

/* livro em cima da mesa */
.carteira-mesa-surface::after {
  content: '📖';
  position: absolute;
  font-size: .65rem;
  top: -12px;
  right: 6px;
}

.carteira-mesa-front {
  width: 64px;
  height: 6px;
  background: linear-gradient(180deg, #a07040 0%, #8b6340 100%);
  border-radius: 0 0 3px 3px;
  border: 1px solid #6b4020;
  border-top: none;
}

.carteira-mesa-legs {
  display: flex;
  justify-content: space-between;
  width: 56px;
}

.carteira-mesa-leg {
  width: 5px;
  height: 14px;
  background: linear-gradient(90deg, #8b6340, #6b4c2a);
  border-radius: 0 0 3px 3px;
}

/* pernas da cadeira (atrás da mesa) */
.cadeira-legs {
  display: flex;
  justify-content: space-between;
  width: 50px;
  margin-top: -14px;
  position: relative;
  z-index: -1;
}

.cadeira-leg {
  width: 4px;
  height: 16px;
  background: #6b4c2a;
  border-radius: 0 0 2px 2px;
}

.carteira-nome {
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.carteira-tag {
  font-size: .55rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  padding: .08rem .35rem;
  margin-top: .2rem;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* balão de fala */
.status-bubble {
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  padding: .22rem .55rem;
  font-size: .62rem;
  color: #555;
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.status-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #ddd;
}

.status-bubble::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid transparent;
  border-top-color: #fff;
  z-index: 1;
}

.sala-vazia {
  text-align: center;
  padding: 2.5rem;
  color: #aaa;
}

/* ─── LIVE2D WIDGET ──────────────────────────────────── */
#waifu {
  z-index: 9999 !important;
  position: fixed !important;
}

/* ─── RANKING ────────────────────────────────────────── */
.podio {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.podio-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.podio-medal { font-size: 1.6rem; }

.podio-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.podio-avatar-1 {
  width: 76px; height: 76px;
  border-color: #ffd700;
  box-shadow: 0 0 0 3px #ffd70055, 0 4px 16px rgba(0,0,0,0.2);
}

.podio-nome {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text);
}

.podio-rev {
  font-size: .72rem;
  color: var(--muted);
}

.podio-base {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  border-radius: 8px 8px 0 0;
  margin-top: .5rem;
}

.podio-base-1 { height: 70px; background: linear-gradient(180deg, #ffd700, #f59e0b); }
.podio-base-2 { height: 50px; background: linear-gradient(180deg, #9ca3af, #6b7280); }
.podio-base-3 { height: 38px; background: linear-gradient(180deg, #d97706, #b45309); }

/* tabela */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.ranking-table thead tr {
  background: var(--primary);
  color: #fff;
}

.ranking-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ranking-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid #f0f4f0;
  vertical-align: middle;
}

.ranking-table tbody tr:hover { background: #f8fdf8; }

.ranking-row-eu {
  background: #e8f5e9 !important;
  font-weight: 600;
}

.ranking-pos {
  font-size: .9rem;
  font-weight: 700;
  color: var(--muted);
  width: 48px;
}

.ranking-aluno {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.ranking-avatar {
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  flex-shrink: 0;
}

/* ─── SELETOR DE AVATAR ──────────────────────────────── */
.avatar-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .8rem;
}

.avatar-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .9rem .5rem .7rem;
  border: 2px solid #c8e6c9;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}

.avatar-style-card input[type="radio"] { display: none; }

.avatar-style-card:hover {
  border-color: var(--primary-light);
  background: #f1f8f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.avatar-style-card.selected {
  border-color: var(--primary);
  background: #e8f5e9;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.15);
}

.avatar-style-nome {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-top: .2rem;
}

/* ─── SALA DE ESTUDOS / CHIBI ────────────────────────── */
.study-room {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.chibi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: flex-start;
}

.chibi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  width: 72px;
}

.chibi-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chibi-avatar {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  border-radius: 8px;
}

.chibi-bob {
  animation: chibi-bob 1.8s ease-in-out infinite;
}

@keyframes chibi-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.chibi-desk {
  width: 64px;
  height: 6px;
  background: linear-gradient(90deg, #a5d6a7, #c8e6c9);
  border-radius: 3px;
  margin-top: 2px;
}

.chibi-nome {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chibi-status {
  font-size: .62rem;
  color: var(--primary-light);
  text-align: center;
}

.chibi-tag {
  font-size: .58rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  padding: .15rem .45rem;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(46,125,50,0.3);
}

/* ─── MINI PERFIL (student home) ────────────────── */
.mini-perfil {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border-radius: 14px;
  padding: .9rem 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1.5px solid #e8f5e9;
  min-width: 260px;
  max-width: 340px;
  margin-left: auto;
}

.mini-perfil-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #c8e6c9;
}

.mini-perfil-info {
  flex: 1;
  min-width: 0;
}

.mini-perfil-nome {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-perfil-turma {
  font-size: .7rem;
  color: var(--muted);
  margin-bottom: .4rem;
}

.mini-perfil-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.mini-tag {
  font-size: .65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 20px;
  padding: .18rem .5rem;
  white-space: nowrap;
}

/* ─── ILUSTRAÇÃO VETERINÁRIA (zero pendentes) ─────── */
.zero-pending-art {
  text-align: center;
  margin-top: .5rem;
}

.zero-pet {
  font-size: 1.8rem;
  display: block;
  animation: pet-float 3s ease-in-out infinite;
}

.zero-msg {
  font-size: .72rem;
  color: #aaa;
  margin-top: .2rem;
}

@keyframes pet-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

/* ─── RESPONSIVO ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 1rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── BOTTOM NAV (mobile) ───────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--sidebar-bg);
  z-index: 500;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: rgba(200,230,201,0.65);
  font-size: .6rem;
  padding: .3rem 0;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.bn-item:active, .bn-active {
  color: #fff !important;
}

.bn-active { color: var(--accent) !important; }

.bn-icon { font-size: 1.3rem; line-height: 1; }
.bn-label { font-size: .58rem; font-weight: 500; }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
}
}

/* ─── MOBILE ─────────────────────────────────────────── */

.hamburger {
  display: none;
  position: fixed;
  top: .7rem;
  left: .7rem;
  z-index: 400;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 350;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .hamburger { display: flex; }

  /* sidebar fora da tela à esquerda */
  .sidebar {
    left: -270px;
    width: 260px;
    transition: left .25s ease;
    z-index: 380;
  }
  .sidebar.open { left: 0; }

  /* conteúdo ocupa tudo */
  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
    padding-top: 4rem !important;
    box-sizing: border-box;
  }

  /* review card ocupa tudo */
  .review-container { max-width: 100% !important; }
  .review-card { padding: 1.2rem !important; }
  .review-card .pergunta { font-size: 1rem !important; }

  /* stats 2 colunas */
  .stat-grid { grid-template-columns: 1fr 1fr !important; gap: .6rem !important; }

  .topbar { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .topbar h1 { font-size: 1.1rem; }
  .mini-perfil { width: 100%; }

  /* ranking */
  .podio { gap: .4rem; }
  .podio-base { width: 58px; font-size: .8rem; }
  .podio-avatar { width: 42px; height: 42px; }
  .podio-avatar-1 { width: 54px; height: 54px; }
  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4),
  .ranking-table th:nth-child(5),
  .ranking-table td:nth-child(5) { display: none; }
  .ranking-table th, .ranking-table td { padding: .5rem .5rem; font-size: .8rem; }
}
