/* ============================================================
   GameF4cil — Painel (Gestão / Professor)  ·  SaaS premium F4cil
   Tema claro refinado · Sora + Manrope · ícones SVG
   ============================================================ */
:root {
  /* Marca */
  --purple-50:  #F5F3FF;
  --purple-100: #EDE9FE;
  --purple-200: #DDD6FE;
  --purple-300: #C4B5FD;
  --purple-400: #A78BFA;
  --purple-500: #8B5CF6;
  --purple-600: #7C3AED;   /* primary */
  --purple-700: #6D28D9;
  --purple-800: #5B21B6;
  --purple-900: #4C1D95;
  --accent-50:  #FFF7ED;
  --accent-100: #FFEDD5;
  --accent-400: #FB923C;
  --accent-500: #F59E0B;
  --accent-600: #EA580C;
  --teal-500:   #14B8A6;

  /* aliases legados (compat) */
  --primary: var(--purple-600);
  --primary-dark: var(--purple-800);
  --primary-light: var(--purple-100);
  --secondary: var(--accent-500);
  --secondary-light: var(--accent-100);

  /* Neutros (com leve tom roxo) */
  --ink:    #1B1830;
  --ink-2:  #423D5C;
  --muted:  #77738F;
  --faint:  #9A97AE;
  --line:   #E9E6F2;
  --line-2: #F2F0F9;
  --bg:     #F5F4FB;
  --surface:   #FFFFFF;
  --surface-2: #FAFAFE;

  /* Estados */
  --success: #15A34A; --success-bg: #DCFCE7; --success-line: #BBF7D0;
  --danger:  #E11D48; --danger-bg:  #FFE4E6; --danger-line:  #FECDD3;
  --warning: #C2570C; --warning-bg: #FEF0C7; --warning-line: #FDE68A;
  --info:    #2563EB; --info-bg:    #DBEAFE; --info-line:    #BFDBFE;
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --card-bg: var(--surface);

  /* Raios & sombras */
  --r-sm: 8px; --r: 12px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;
  --radius: var(--r);
  --sh-sm: 0 1px 2px rgba(27,24,48,.06);
  --sh:    0 2px 6px rgba(27,24,48,.05), 0 1px 2px rgba(27,24,48,.04);
  --sh-md: 0 10px 26px -10px rgba(27,24,48,.14), 0 2px 6px rgba(27,24,48,.05);
  --sh-lg: 0 24px 50px -18px rgba(76,29,149,.28);
  --sh-purple: 0 10px 24px -8px rgba(124,58,237,.5);
  --shadow: var(--sh);

  --sidebar-w: 260px;
  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--purple-200); color: var(--purple-900); }

/* textura suave do fundo */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 40% at 100% 0%, rgba(124,58,237,.05), transparent 70%),
    radial-gradient(35% 35% at 0% 100%, rgba(245,158,11,.045), transparent 70%);
}

.ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ============================================================ SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: linear-gradient(180deg, #3B1D73 0%, var(--purple-900) 55%, #3A1580 100%);
  display: flex; flex-direction: column; z-index: 200;
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 6px 0 32px -18px rgba(27,24,48,.5);
}
.sidebar::after { /* brilho lateral */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 30% at 0% 0%, rgba(255,255,255,.06), transparent 60%);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 11px; padding: 22px 22px 18px;
}
.sidebar-logo-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple-500), var(--accent-500));
  box-shadow: 0 6px 16px -4px rgba(124,58,237,.7); color: #fff; flex-shrink: 0;
}
.sidebar-logo-icon .ico { width: 21px; height: 21px; }
.sidebar-logo-img { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.sidebar-logo-text { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.sidebar-logo-text b { color: #fff; } .sidebar-logo-text span { color: var(--accent-400); }

.sidebar-escola {
  margin: 4px 14px 10px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 11px;
}
.sidebar-escola-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.1); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.sidebar-escola-ic .ico { width: 18px; height: 18px; }
.sidebar-escola-meta { min-width: 0; display: flex; flex-direction: column; }
.sidebar-escola-meta span, .sidebar-escola span { color: #fff; font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-perfil { color: rgba(255,255,255,.55); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

.sidebar-nav { flex: 1; padding: 6px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-cap { font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.35); padding: 14px 12px 6px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  color: rgba(255,255,255,.72); font-size: .9rem; font-weight: 600;
  border-radius: 10px; position: relative;
  transition: background .16s, color .16s;
}
.sidebar-link .ico { width: 19px; height: 19px; opacity: .85; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sidebar-link.active .ico { opacity: 1; color: var(--accent-400); }
.sidebar-link.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent-500);
}
.s-icon { display: none; } /* legado: emojis escondidos onde restarem */
.sidebar-divider { height: 1px; background: rgba(255,255,255,.1); margin: 8px 12px; }

.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user { display: flex; align-items: center; gap: 11px; }
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 700; color: #fff; font-size: .95rem;
}
.sidebar-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sidebar-user-nome { color: #fff; font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: none; background: none; cursor: pointer;
  color: rgba(255,255,255,.55); font-size: .76rem; font-weight: 600; font-family: inherit; transition: color .15s;
}
.sidebar-logout .ico { width: 14px; height: 14px; }
.sidebar-logout:hover { color: #fff; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(27,24,48,.5); backdrop-filter: blur(2px); z-index: 199; }

/* ============================================================ TOPBAR (mobile) */
.topbar {
  display: flex; position: sticky; top: 0; z-index: 100; margin-left: var(--sidebar-w);
  background: linear-gradient(90deg, var(--purple-800), var(--purple-900));
  padding: 12px 16px; align-items: center; gap: 12px;
  box-shadow: 0 4px 16px -6px rgba(27,24,48,.4);
}
.topbar-menu-btn { background: none; border: none; color: #fff; cursor: pointer; display: none; place-items: center; padding: 4px; }
.topbar-menu-btn .ico { width: 24px; height: 24px; }
.topbar-title { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.topbar-logo-img { width: 24px; height: 24px; object-fit: contain; }
.topbar-empresa-form { margin-left: auto; }
.topbar-empresa-form select { max-width: 155px; padding: 7px 28px 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; font: 600 .72rem var(--font-body); }
.topbar-empresa-form option { color: var(--ink); background: #fff; }

/* ============================================================ LAYOUT */
.page-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1140px; margin: 36px auto; padding: 0 32px; width: 100%; }
.container-sm { max-width: 560px; } .container-md { max-width: 800px; }

/* ============================================================ AUTH */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--purple-800), var(--purple-900)); padding: 24px; }
.auth-container { background: var(--surface); padding: 40px 36px; border-radius: var(--r-lg); box-shadow: var(--sh-lg); width: 100%; max-width: 410px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; }
.auth-logo-full { width: 210px; max-width: 72%; height: auto; }
.auth-logo-product { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--accent-500); letter-spacing: .02em; }
.auth-logo-product b { color: var(--purple-700); }
.auth-container h2 { text-align: center; margin-bottom: 24px; color: var(--ink); font-family: var(--font-display); }
.auth-link { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--muted); }
.auth-link a { color: var(--purple-600); font-weight: 700; }
.empresa-auth { max-width: 560px; }
.empresa-form { max-width: 760px; }
.empresa-intro { margin: -14px 0 22px; text-align: center; color: var(--muted); font-size: .9rem; }
.empresa-lista { display: grid; gap: 10px; margin-bottom: 18px; }
.empresa-opcao { width: 100%; display: grid; grid-template-columns: 42px 1fr 20px; align-items: center; gap: 12px; padding: 13px; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); cursor: pointer; font-family: inherit; transition: border-color .16s, transform .16s, box-shadow .16s; }
.empresa-opcao:hover { border-color: var(--purple-300); transform: translateY(-1px); box-shadow: var(--sh-md); }
.empresa-opcao-ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,var(--purple-500),var(--purple-700)); }
.empresa-opcao strong, .empresa-opcao small { display: block; }
.empresa-opcao small { margin-top: 2px; color: var(--muted); text-transform: capitalize; }
.empresa-auth > .btn-block, .empresa-auth > form > .btn-block { width: 100%; margin-top: 10px; }

/* ============================================================ PAGE HEADER */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head-l { min-width: 0; }
.page-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--purple-600); margin-bottom: 8px; }
.page-eyebrow .ico { width: 15px; height: 15px; }
.page-header h1, h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.page-header .subtitulo, .subtitulo { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
h2 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin-bottom: 14px; color: var(--ink); }

/* ============================================================ CARDS / STATS */
.card { background: var(--surface); border-radius: var(--r-md); padding: 22px; box-shadow: var(--sh); border: 1px solid var(--line); }
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 28px; }
.card-stat {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card-stat:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--purple-200); }
a.card-stat { text-decoration: none; color: inherit; cursor: pointer; }
a.card-stat:hover { border-color: var(--purple-300); }
.stat-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.stat-ic .ico { width: 25px; height: 25px; }
.stat-ic.c-purple { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); box-shadow: 0 8px 18px -8px rgba(124,58,237,.7); }
.stat-ic.c-teal   { background: linear-gradient(135deg, #2DD4BF, var(--teal-500)); box-shadow: 0 8px 18px -8px rgba(20,184,166,.6); }
.stat-ic.c-blue   { background: linear-gradient(135deg, #60A5FA, #2563EB); box-shadow: 0 8px 18px -8px rgba(37,99,235,.6); }
.stat-ic.c-amber  { background: linear-gradient(135deg, var(--accent-400), var(--accent-500)); box-shadow: 0 8px 18px -8px rgba(245,158,11,.6); }
.stat-meta { display: flex; flex-direction: column; min-width: 0; }
.stat-valor { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.stat-label { font-size: .84rem; color: var(--muted); margin-top: 4px; font-weight: 500; }
.stat-icon { display: none; } /* legado */
.card-alerta::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent-500), var(--accent-600)); }

/* ============================================================ BOTÕES */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-family: var(--font-body); font-size: .9rem; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; white-space: nowrap;
  transition: background .16s, box-shadow .16s, transform .1s, border-color .16s, color .16s;
}
.btn .ico { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--purple-600); color: #fff; box-shadow: 0 6px 16px -8px rgba(124,58,237,.8); }
.btn-primary:hover { background: var(--purple-700); box-shadow: var(--sh-purple); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-sm); }
.btn-secondary:hover { background: var(--purple-50); border-color: var(--purple-200); color: var(--purple-700); }
.btn-ok { background: var(--success); color: #fff; }
.btn-ok:hover { background: #128a3f; }
.btn-perigo { background: var(--danger); color: #fff; }
.btn-perigo:hover { background: #be123c; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 9px; }

/* Botões-ícone (ações em tabela/card) */
.row-actions { display: inline-flex; align-items: center; gap: 8px; }
.row-actions form { display: inline-flex; margin: 0; }
.btn-icon {
  width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-icon .ico { width: 17px; height: 17px; }
.btn-icon:hover { background: var(--purple-50); border-color: var(--purple-200); color: var(--purple-700); transform: translateY(-1px); }
.btn-icon:active { transform: translateY(0); }
.btn-icon--danger:hover { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.btn-icon--ok:hover { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }

/* ============================================================ BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 700; line-height: 1.4; border: 1px solid transparent;
}
.badge .ico { width: 13px; height: 13px; }
.badge-ok, .badge-aprovada { background: var(--success-bg); color: #12703A; border-color: var(--success-line); }
.badge-off, .badge-rejeitada { background: var(--line-2); color: var(--muted); border-color: var(--line); }
.badge-pendente { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.badge-perigo { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge-purple { background: var(--purple-100); color: var(--purple-700); border-color: var(--purple-200); }

/* ============================================================ TABELA */
.tabela-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh); overflow: hidden; }
.tabela { width: 100%; border-collapse: collapse; background: var(--surface); }
.tabela thead th {
  background: var(--surface-2); color: var(--muted); padding: 13px 16px; text-align: left;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tabela tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: .9rem; color: var(--ink-2); vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr { transition: background .12s; }
.tabela tbody tr:hover td { background: var(--purple-50); }
.tabela td strong { color: var(--ink); font-weight: 700; }
.cell-num { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); }
.cell-num .ico { width: 15px; height: 15px; }
.cell-num.coin { color: var(--accent-600); } .cell-num.xp { color: var(--purple-600); }
.th-num { text-align: left; }
.tabela-total { margin-top: 12px; font-size: .82rem; color: var(--muted); font-weight: 500; }

/* ============================================================ FORMULÁRIOS */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh); padding: 26px; margin-bottom: 20px; }
.form-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.form-card-head .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--purple-50); color: var(--purple-600); display: grid; place-items: center; }
.form-card-head .ic .ico { width: 19px; height: 19px; }
.form-card-head h2 { margin: 0; font-size: 1.05rem; }
.form-group { margin-bottom: 17px; }
.form-group label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.form-group input[type=text], .form-group input[type=email], .form-group input[type=password],
.form-group input[type=number], .form-group input[type=date], .form-group textarea, .form-group select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .94rem; font-family: inherit; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--faint); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--purple-400); box-shadow: 0 0 0 4px var(--purple-100);
}
.form-row { display: flex; gap: 16px; } .form-row .form-group { flex: 1; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.form-check { display: flex; align-items: center; gap: 9px; }
.form-check input { width: auto; accent-color: var(--purple-600); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ============================================================ ALERTAS */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-size: .9rem; font-weight: 600; border: 1px solid transparent; }
.alert .ico { width: 18px; height: 18px; flex-shrink: 0; }
.alert-erro { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert-sucesso { background: var(--success-bg); color: #12703A; border-color: var(--success-line); }

/* ============================================================ SEARCH */
.search-bar { margin-bottom: 18px; }
.search-wrap { position: relative; max-width: 420px; }
.search-wrap .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search-wrap input, .search-bar input {
  width: 100%; max-width: 420px; padding: 11px 14px 11px 40px; border: 1.5px solid var(--line);
  border-radius: 11px; font-size: .92rem; font-family: inherit; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus, .search-bar input:focus { outline: none; border-color: var(--purple-400); box-shadow: 0 0 0 4px var(--purple-100); }

/* ── Gerenciador de alunos da turma (turma_detalhe) ── */
.vinc-count { margin-left: auto; font-size: .82rem; font-weight: 800; color: var(--purple-700); background: var(--purple-100); border: 1px solid var(--purple-200); padding: 5px 13px; border-radius: 50px; white-space: nowrap; }
.vinc-legenda { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.vinc-legenda span { display: inline-flex; align-items: center; gap: 7px; }
.vinc-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.vinc-dot.on { background: var(--purple-600); }
.vinc-dot.outra { background: var(--warning); }
.vinc-dot.livre { background: var(--line-2); border: 1px solid var(--line); }
.vinc-list { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; padding: 3px; margin: 0 -3px; }
.vinc-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s, box-shadow .14s; }
.vinc-item:hover { border-color: var(--purple-200); background: var(--purple-50); }
.vinc-item input { position: absolute; opacity: 0; pointer-events: none; }
.vinc-check { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line-2); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: background .14s, border-color .14s; }
.vinc-check svg { opacity: 0; transition: opacity .14s; }
.vinc-item.on { border-color: var(--purple-400); background: var(--purple-50); box-shadow: 0 0 0 3px var(--purple-100); }
.vinc-item.on .vinc-check { background: var(--purple-600); border-color: var(--purple-600); }
.vinc-item.on .vinc-check svg { opacity: 1; }
.vinc-av { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--purple-500), var(--accent-500)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.vinc-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vinc-nome { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vinc-meta { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.vinc-meta svg { vertical-align: -1px; }
.vinc-badge { flex-shrink: 0; white-space: nowrap; }
.vinc-vazio { text-align: center; color: var(--muted); padding: 24px; font-size: .9rem; }
@media (max-width: 560px) { .vinc-meta { display: none; } .vinc-badge { font-size: .66rem; padding: 3px 8px; } }

/* ── Professores: linha expansível + drop de turmas ── */
.prof-row { cursor: pointer; }
.prof-row:hover > td { background: var(--purple-50); }
.prof-row.aberto > td { background: var(--purple-50); }
.prof-caret { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--faint); vertical-align: -3px; margin-right: 2px; transition: transform .3s cubic-bezier(.2,.8,.2,1), color .2s; }
.prof-caret svg { width: 15px; height: 15px; }
.prof-row.aberto .prof-caret { transform: rotate(90deg); color: var(--purple-600); }
.prof-turmas-badge { gap: 5px; }
.prof-drop > td { padding: 0 !important; border: none !important; background: var(--purple-50); }
.prof-drop-inner { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.2,.8,.2,1), opacity .3s ease; }
.prof-drop-body { padding: 16px 20px 20px; }
.prof-drop-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; color: var(--purple-700); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 14px; }
.prof-drop-head svg { width: 16px; height: 16px; }
.prof-drop-head strong { color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 800; }
.prof-drop-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .prof-drop-inner, .prof-caret { transition: none; } }

/* ============================================================ QUICK ACTIONS */
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-title { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--ink); margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title .ico { width: 18px; height: 18px; color: var(--purple-500); }

/* ============================================================ GRIDS (turmas / produtos) */
.tarefas-grid, .produtos-grid, .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.tarefa-card, .produto-card {
  background: var(--surface); border-radius: var(--r-md); padding: 20px; box-shadow: var(--sh);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tarefa-card:hover, .produto-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--purple-200); }
.tarefa-card.tarefa-aprovada { border-color: var(--success-line); }
.tarefa-card.tarefa-pendente { border-color: var(--warning-line); }
.tarefa-card.tarefa-rejeitada { opacity: .7; }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--purple-50); color: var(--purple-600); display: grid; place-items: center; flex-shrink: 0; }
.card-ic .ico { width: 21px; height: 21px; }
.tarefa-titulo, .produto-nome { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.tarefa-desc, .produto-desc { font-size: .86rem; color: var(--muted); line-height: 1.5; }
.tarefa-recompensa { display: flex; gap: 14px; font-size: .9rem; font-weight: 700; }
.turma-meta { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); align-items: center; }
.turma-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.turma-meta .ico { width: 15px; height: 15px; color: var(--faint); }
.turma-alunos { color: var(--purple-600) !important; font-weight: 700; }
.turma-alunos .ico { color: var(--purple-500) !important; }
.produto-custo { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--accent-600); }
.produto-custo .ico { width: 18px; height: 18px; }
.produto-estoque { font-size: .82rem; color: var(--muted); }
.produto-inativo, .produto-sem-saldo { opacity: .62; }
.produto-img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 4px; }
.produto-img-placeholder { width: 100%; height: 110px; display: grid; place-items: center; background: var(--purple-50); border-radius: var(--r); border: 1px dashed var(--purple-200); color: var(--purple-400); margin-bottom: 4px; }
.produto-img-placeholder .ico { width: 40px; height: 40px; }
.card-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }

/* ============================================================ RANKING */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ranking-lista { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; font-size: .9rem; transition: background .12s; }
.ranking-item:hover { background: var(--surface-2); }
.ranking-eu { background: var(--purple-50) !important; box-shadow: inset 0 0 0 1px var(--purple-200); }
.ranking-pos { font-family: var(--font-display); font-weight: 700; color: var(--muted); min-width: 30px; text-align: center; font-size: .9rem; }
.ranking-item:nth-child(1) .ranking-pos { color: #B8860B; } .ranking-item:nth-child(2) .ranking-pos { color: #7A8290; } .ranking-item:nth-child(3) .ranking-pos { color: #B06A34; }
.ranking-av { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--purple-400), var(--purple-600)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.ranking-nome { flex: 1; font-weight: 600; color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-xp { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: .84rem; }
.ranking-xp .ico { width: 14px; height: 14px; }
.ranking-xp .v-xp { color: var(--purple-600); display: inline-flex; align-items: center; gap: 4px; }
.ranking-xp .v-coin { color: var(--accent-600); display: inline-flex; align-items: center; gap: 4px; }

/* ============================================================ CONVITE */
.convite-box { background: linear-gradient(135deg, var(--purple-600), var(--purple-800)); border-radius: var(--r-lg); padding: 32px; text-align: center; color: #fff; box-shadow: var(--sh-lg); margin-bottom: 22px; }
.convite-codigo { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: 10px; margin: 16px 0; }
.convite-url { font-size: .85rem; opacity: .85; margin-bottom: 8px; }
.convite-link { display: flex; gap: 8px; }
.convite-link input { flex: 1; font-size: .82rem; }

/* ============================================================ EMPTY / MISC */
.empty-msg { color: var(--muted); font-size: .92rem; padding: 20px 0; }
.empty-state { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md); }
.empty-state .empty-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--purple-50); color: var(--purple-400); display: grid; place-items: center; }
.empty-state .empty-ic .ico { width: 30px; height: 30px; }
.empty-state .empty-msg { padding: 0; }
.org-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--purple-100); color: var(--purple-700); padding: 4px 12px; border-radius: var(--r-pill); font-size: .82rem; font-weight: 600; }

/* checkbox grid (turmas) */
.turmas-check-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.turma-check-item { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: border-color .15s, background .15s, color .15s; }
.turma-check-item input { width: auto; accent-color: var(--purple-600); }
.turma-check-item:has(input:checked) { border-color: var(--purple-400); background: var(--purple-50); color: var(--purple-700); }

/* Seletor de tamanho de farda — pills segmentadas (escolha única) */
.farda-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.farda-pill { position: relative; cursor: pointer; }
.farda-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.farda-pill span {
  display: grid; place-items: center; min-width: 48px; padding: 9px 15px;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px;
  font-size: .9rem; font-weight: 700; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .1s;
}
.farda-pill:hover span { border-color: var(--purple-200); color: var(--purple-700); }
.farda-pill:active span { transform: translateY(1px); }
.farda-pill:has(input:checked) span {
  border-color: var(--purple-600); background: var(--purple-600); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(124, 58, 237, .7);
}
.farda-pill:has(input:focus-visible) span { outline: 2px solid var(--purple-400); outline-offset: 2px; }
.farda-pill.farda-none span { min-width: 42px; font-weight: 600; color: var(--muted); }
.farda-pill.farda-none:has(input:checked) span { background: var(--ink-2); border-color: var(--ink-2); color: #fff; box-shadow: none; }

/* animação de entrada */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.rise-2 { animation-delay: .06s; } .rise-3 { animation-delay: .12s; } .rise-4 { animation-delay: .18s; }

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .topbar { display: flex; margin-left: 0; }
  .topbar-menu-btn { display: grid; }
  .page-wrapper { margin-left: 0; }
  .container { margin: 20px auto; padding: 0 18px; }
  .form-row { flex-direction: column; gap: 0; }
  .page-header { align-items: stretch; }
  .tabela-wrap { overflow-x: auto; }
  .tabela { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) { .rise, .card-stat, .tarefa-card, .produto-card, .btn, .btn-icon { animation: none !important; transition: none !important; } }
