/* Ollie Idiomas · plataforma (mesma identidade dos apps dos cursos) */
:root {
  --ink: #2D2A4A; --ink2: #5B5875; --muted: #6C6987; --line: #E6E2EF; --soft: #F6F4FB; --bg: #F6F4FB;
  --navy: #221F3F; --roxo: #9B6BFF; --roxo-d: #6F45D1; --coral: #FF7A59; --amarelo: #FFC83B;
  --verde: #36B37E; --azul: #4C9AFF; --rosa: #E84393; --vermelho: #D64545;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Nunito, system-ui, sans-serif; font-size: 16px; line-height: 1.45; overflow-x: clip; }
h1, h2, h3, .disp { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(28px, 3.2vw, 38px); }
h2 { font-size: 22px; }
a { color: var(--roxo-d); font-weight: 800; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.lbl { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #C2401F; }
.lbl a { color: inherit; }
.lbl-light { color: var(--amarelo); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: 800 15px Nunito, sans-serif;
  cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 var(--line); transition: transform .08s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn-primary { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 4px 0 #C9512F; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; box-shadow: 0 2px 0 var(--line); }
.btn-danger { background: var(--vermelho); border-color: var(--vermelho); color: #fff; box-shadow: 0 4px 0 #9E2C2C; }
.btn-danger-ghost { color: var(--vermelho); border-color: #F3C9C9; }
button.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }

/* formulários */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .filters label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input:not([type]), select, textarea {
  min-height: 46px; border-radius: 12px; border: 2px solid var(--line); padding: 0 14px; font: 600 15px Nunito, sans-serif;
  color: var(--ink); background: #fff; width: 100%; }
input:focus, select:focus { outline: 3px solid #D9C8FF; border-color: var(--roxo); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--roxo); }
fieldset { border: 2px dashed var(--line); border-radius: 14px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
legend { font-weight: 900; padding: 0 6px; }
.has-err input, .has-err select { border-color: var(--vermelho); }
.err { color: var(--vermelho); font-size: 13px; font-weight: 800; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline select { min-height: 34px; width: auto; padding: 0 8px; font-size: 13px; border-radius: 10px; }

/* avisos */
.flash { padding: 12px 16px; border-radius: 14px; font-weight: 800; margin-bottom: 16px; border: 2px solid; }
.flash-ok { background: #E7F7EF; border-color: #A9E2C6; color: #1F7E56; }
.flash-erro { background: #FDECEC; border-color: #F3C2C2; color: #A83232; }

/* cartões e tabelas */
.card { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 0 var(--line); margin-bottom: 22px; }
.card h2 { margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.narrow { max-width: 520px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.inativo td { opacity: .6; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; margin: 2px 2px 2px 0; }
.tag-ingles { background: #EAF3FF; color: #2F6FCC; }
.tag-italiano { background: #E7F7EF; color: #1F7E56; }
.tag-espanhol { background: #FEF3DF; color: #B9770E; }
.tag-off { background: #F1F0F5; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.st-ativa { background: #E7F7EF; color: #1F7E56; }
.st-trancada { background: #FFF4D6; color: #8A5B00; }
.st-cancelada { background: #FDECEC; color: #A83232; }
.st-concluida { background: #F2ECFF; color: #6F45D1; }
.bar { height: 10px; border-radius: 10px; background: var(--soft); overflow: hidden; margin: 8px 0 6px; }
.bar > div { height: 100%; background: var(--cor, var(--roxo)); border-radius: 10px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 16px; font-weight: 800; }

/* ---------- admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.side { width: 250px; flex: none; background: var(--navy); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none !important; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: Fredoka, sans-serif; font-size: 18px; }
.brand small { font-size: 12px; font-weight: 700; opacity: .75; }
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side nav a { color: #E6E2EF; padding: 11px 14px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.side nav a:hover { background: rgba(255,255,255,.08); }
.side nav a.on { background: var(--roxo); color: #fff; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: #CFCADF; }
.admin-main { flex: 1; min-width: 0; padding: 30px clamp(16px, 3vw, 44px) 60px; max-width: 1300px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 4px 0 var(--line); }
.stat b { display: block; font: 700 34px Fredoka, sans-serif; }
.stat span { color: var(--muted); font-weight: 800; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px; }
.curso-card { border-top: 8px solid var(--cor); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; text-align: center; }
.mini-stats div { background: var(--soft); border-radius: 12px; padding: 10px 4px; }
.mini-stats b { display: block; font: 700 24px Fredoka, sans-serif; }
.mini-stats span { font-size: 11px; font-weight: 800; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .grow { flex: 1 1 260px; }
.filters select { width: auto; min-width: 140px; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.grid-form .danger-zone { grid-column: 2; }
.grid-form.novo { grid-template-columns: minmax(0, 860px); }
@media (max-width: 1250px) {
  .grid-form { grid-template-columns: minmax(0, 860px); }
  .grid-form .danger-zone { grid-column: auto; }
}
.mat { border: 2px solid var(--line); border-left: 6px solid var(--cor); border-radius: 14px; padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.mat-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; }
.mat form { margin-top: 6px; }
.add-mat { border-top: 2px dashed var(--line); padding-top: 14px; margin-top: 8px; }
.danger-zone { border-color: #F3C9C9; box-shadow: 0 4px 0 #F3C9C9; }

/* ---------- login ---------- */
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 85% 10%, #FF7A5933 0 220px, transparent 221px), radial-gradient(circle at 10% 95%, #9B6BFF33 0 260px, transparent 261px), var(--bg); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 2px solid var(--line); border-radius: 26px; padding: 30px; box-shadow: 0 6px 0 var(--line); display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand b { display: block; font: 700 20px Fredoka, sans-serif; }
.auth-brand span { color: var(--muted); font-weight: 800; font-size: 14px; }
.auth-card p { margin: 0; }

/* ---------- aluno ---------- */
.topbar { background: var(--navy); color: #fff; padding: 12px clamp(16px, 3vw, 44px); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.topbar nav a, .topbar button.link { color: #E6E2EF; text-decoration: none; }
.topbar nav a.on { color: var(--amarelo); }
.aluno-main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; }
.hero { background: var(--navy); color: #fff; border-radius: 28px; padding: 30px clamp(20px, 4vw, 40px); display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: var(--coral); opacity: .9; z-index: 0; }
.hero > * { position: relative; z-index: 1; }
.hero p { color: #E6E2EF; font-weight: 700; max-width: 560px; margin: 10px 0 0; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.course { background: #fff; border: 2px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 5px 0 var(--line); display: flex; flex-direction: column; }
.course-cover { background: var(--navy); color: #fff; padding: 24px; position: relative; overflow: hidden; min-height: 190px; }
.course-cover::before { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: var(--cor); }
.course-cover > * { position: relative; }
.course-cover h2 { font-size: 26px; margin: 12px 0 8px; color: #fff; }
.course-cover p { margin: 0; color: #CFCADF; font-weight: 700; font-size: 14px; }
.chip { display: inline-block; background: var(--amarelo); color: var(--navy); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 900; }
.course-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body .btn { margin-top: auto; }
.course-prog { font-weight: 800; }
.course-prog b { font: 700 26px Fredoka, sans-serif; }
.course-off .course-cover { filter: grayscale(.7); }

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; gap: 14px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .danger-zone { grid-column: auto; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 28px; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 22px 18px; border-radius: 22px; }
  .hero svg { display: none; }
  .card { padding: 18px 16px; }
  .auth-card { padding: 22px 18px; border-radius: 22px; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .grow { flex: none; }
  .filters select, .filters .btn { width: 100%; }
  .side-foot { flex-wrap: wrap; }
}
