:root {
  --vermelho: #d81f26;
  --vermelho-escuro: #b3151c;
  --azul: #0f2a4a;
  --azul-claro: #16406e;
  --cinza-bg: #f1f3f7;
  --cinza-borda: #e2e8f0;
  --cinza-texto: #4a5568;
  --texto: #1f2937;
  --verde: #1a7f37;
  --sombra: 0 8px 30px rgba(15, 42, 74, 0.12);
  --radius: 12px;
  --fonte: 'Inter', Arial, sans-serif;
}

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

body {
  font-family: var(--fonte);
  color: var(--texto);
  background: var(--cinza-bg);
  font-size: 15px;
}

a { color: var(--azul); }

/* ---- Layout admin ---- */
.admin { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--azul);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: block;
  padding: 1.2rem 1.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  transition: background 0.2s, color 0.2s;
}

.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-link.ativo { background: var(--vermelho); color: #fff; }

.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 0.6rem 0.8rem; }

.conteudo { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--cinza-borda);
  padding: 0.65rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-topbar h1 { font-size: 1.25rem; }

.admin-usuario-nome { font-weight: 600; font-size: 0.95rem; }

.menu-mobile { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--azul); }

.admin-corpo { padding: 1rem 1.75rem 1.75rem; flex: 1; }

/* ---- Cartões de resumo ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }

.card-mini {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 1.4rem;
}

.card-mini strong { display: block; font-size: 1.9rem; color: var(--vermelho); }
.card-mini span { color: var(--cinza-texto); font-size: 0.9rem; }

.painel-card { background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); padding: 1.5rem; }

/* ---- Tabelas ---- */
.tabela-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); overflow-x: auto; }

table.tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

table.tabela th, table.tabela td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--cinza-borda); vertical-align: middle; }

table.tabela th { background: #f8fafc; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--cinza-texto); }

table.tabela tr:last-child td { border-bottom: none; }
table.tabela tr:hover td { background: #fafbfd; }

.acoes { display: flex; gap: 0.4rem; }
.acoes .btn { min-width: 110px; text-align: center; justify-content: center; }

/* ---- Botões ---- */
.btn {
  display: inline-block;
  font-family: var(--fonte);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primario { background: var(--vermelho); color: #fff; }
.btn-primario:hover { background: var(--vermelho-escuro); }
.btn-azul { background: var(--azul); color: #fff; }
.btn-azul:hover { background: var(--azul-claro); }
.btn-pequeno { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.btn-cinza { background: #e2e8f0; color: var(--texto); }
.btn-verde { background: var(--verde); color: #fff; }
.btn-perigo { background: #fee2e2; color: #991b1b; }
.btn-perigo:hover { background: #fecaca; }

.btn--feito { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---- Modal de contrato ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-box { background: #fff; border-radius: 8px; width: 92%; max-width: 920px; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.modal-bar { display: flex; gap: 0.5rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.modal-box iframe { flex: 1; border: 0; width: 100%; min-height: 72vh; background: #fff; }

/* ---- Formulários ---- */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); padding: 1.8rem; margin-bottom: 2rem; max-width: 640px; }
.form-card h2 { font-size: 1.1rem; margin-bottom: 1.2rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--cinza-borda);
  border-radius: 8px;
  font-family: var(--fonte);
  font-size: 0.95rem;
  color: var(--texto);
  background: #fbfcfe;
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--vermelho);
  box-shadow: 0 0 0 3px rgba(216, 31, 38, 0.15);
}

.form-acoes { display: flex; gap: 0.8rem; margin-top: 0.5rem; align-items: center; }

/* ---- Flash ---- */
.flash { margin: 1.5rem 2rem 0; padding: 0.9rem 1.2rem; border-radius: 8px; font-weight: 600; font-size: 0.92rem; }
.flash-sucesso { background: #dcfce7; color: #166534; }
.flash-erro { background: #fee2e2; color: #991b1b; }
.flash-aviso { background: #fef3c7; color: #92400e; }

/* ---- Empty state ---- */
.vazio { text-align: center; padding: 2.5rem; color: var(--cinza-texto); }

/* ---- Login dividido ---- */
.login-split { display: flex; min-height: 100vh; }

.login-form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--cinza-bg);
}

.login-banner-side {
  flex: 1 1 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--vermelho), #8e1218);
}

.login-banner-side::before, .login-banner-side::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  z-index: 0;
}
.login-banner-side::before { width: 340px; height: 340px; top: -90px; right: -90px; }
.login-banner-side::after { width: 240px; height: 240px; bottom: -70px; left: -50px; }

.login-banner-conteudo { position: relative; z-index: 1; max-width: 440px; }
.login-banner-conteudo .destaque { font-size: 3.2rem; line-height: 1; margin-bottom: 1rem; }
.login-banner-conteudo h2 { font-size: 1.9rem; margin-bottom: 0.8rem; }
.login-banner-conteudo p { font-size: 1.02rem; line-height: 1.65; opacity: 0.92; }

.login-banner-lista { list-style: none; margin-top: 1.5rem; display: grid; gap: 0.65rem; }
.login-banner-lista li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.96rem; }
.login-banner-lista li::before {
  content: "\2713";
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22); font-size: 0.78rem; flex-shrink: 0;
}

.login-card { background: #fff; border-radius: var(--radius); box-shadow: var(--sombra); width: 100%; max-width: 420px; padding: 2.5rem; }

.login-brand { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1.4rem; }
.login-brand-icone { font-size: 1.9rem; line-height: 1; }
.login-brand-nome { font-weight: 800; font-size: 1.25rem; color: var(--vermelho); letter-spacing: 0.3px; }

.login-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 0.3rem; }
.login-card .login-sub { text-align: center; color: var(--cinza-texto); font-size: 0.9rem; margin-bottom: 1.6rem; }
.login-card .btn { width: 100%; }

.login-erro { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.87rem; margin-bottom: 1.2rem; }
.login-aviso { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 0.8rem 1rem; font-size: 0.87rem; margin-bottom: 1.2rem; }
.login-rodape { margin-top: 1.2rem; font-size: 0.85rem; color: #64748b; text-align: center; }

/* ---- Responsivo ---- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%); transition: transform 0.3s; z-index: 200; overflow-y: auto;
  }
  .sidebar.aberta { transform: translateX(0); }
  .menu-mobile { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .login-banner-side { display: none; }
}

/* ---- Topbar da Área do Aluno ---- */
.topbar {
  background: var(--azul);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.6rem;
}
.topbar-marca { font-weight: 800; font-size: 1.1rem; letter-spacing: 0.3px; }
.topbar-usuario { display: flex; align-items: center; gap: 0.9rem; font-size: 0.92rem; }

/* ---- Painel do aluno ---- */
.lista-aulas { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.lista-aulas li {
  background: var(--cinza-bg);
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.92rem;
}
.dados-aluno { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem 1.4rem; }
.dados-aluno p { font-size: 0.93rem; }
.dados-aluno strong { color: var(--azul); }

.tag-agendada, .tag-concluida, .tag-cancelada {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 20px; margin-left: 0.4rem;
}
.tag-agendada { background: #dbeafe; color: #1e40af; }
.tag-concluida { background: #dcfce7; color: #166534; }
.tag-cancelada { background: #fee2e2; color: #991b1b; }

.titulo-pagina { font-size: 1.5rem; color: var(--azul); margin: 1.6rem 0 1.2rem; }

.card {
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.4rem;
}
.card h2 { font-size: 1.1rem; color: var(--azul); margin-bottom: 1rem; }

/* Conteúdo da área do aluno (sem sidebar) */
.aluno-area .conteudo {
  padding: 0 1.6rem 2.5rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

/* Tags de status / pagamento */
.tag-pago, .tag-pendente, .tag-agendada, .tag-concluida, .tag-cancelada {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .12rem .5rem;
  border-radius: 999px;
  margin-left: .3rem;
  vertical-align: middle;
}
.tag-pago, .tag-concluida { background: #e6f4ea; color: #1a7f37; }
.tag-pendente, .tag-agendada { background: #fff4e5; color: #b26a00; }
.tag-cancelada { background: #fdeaea; color: #b3151c; }

.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 999px;
}
.badge-ok { background: #e6f4ea; color: #1a7f37; }
.badge-aviso { background: #fff4e5; color: #b26a00; }

/* ---- Estilos da Navegação da Área do Aluno & Central de Mensagens ---- */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.topbar-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.topbar-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.topbar-link.ativo {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.badge-notif-aluno {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

/* Chat & Histórico de Dúvidas */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.chat-linha {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.chat-linha-aluno {
  align-self: flex-start;
}
.chat-linha-instrutor {
  align-self: flex-end;
}
.chat-bolha {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  font-size: 0.94rem;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  word-break: break-word;
}
.chat-bolha-aluno {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-top-left-radius: 2px;
}
.chat-bolha-instrutor {
  background: #0f2a4a;
  color: #ffffff;
  border-top-right-radius: 2px;
}
.chat-bolha-bloqueada {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border: 1.5px dashed #f87171 !important;
}
.chat-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  margin-bottom: 0.35rem;
}
.chat-linha-instrutor .chat-meta {
  justify-content: flex-end;
}
.chat-autor-aluno {
  font-weight: 700;
  color: #0f2a4a;
}
.chat-autor-instrutor {
  font-weight: 700;
  color: #38bdf8;
}
.chat-data {
  color: #64748b;
}

/* Badges de Status de Dúvidas */
.badge-status-aberta {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #fde68a;
}
.badge-status-respondida {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #bbf7d0;
}
.badge-status-fechada {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
}

/* Abas de Navegação nas Mensagens */
.abas-mensagens {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}
.aba-msg-btn {
  padding: 0.65rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  background: #f8fafc;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.aba-msg-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.aba-msg-btn.ativa {
  background: #0f2a4a;
  color: #ffffff;
  border-color: #0f2a4a;
}

