/* ============================================================
   ProfeFlix — style.css
   Design: Moderno, limpo, infantil e profissional
   Fonte: Inter (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variáveis globais ─────────────────────────────────── */
:root {
  /* Paleta principal */
  --primary:        #2563EB;
  --primary-hover:  #1D4ED8;
  --primary-light:  #3B82F6;
  --primary-50:     #EFF6FF;
  --primary-100:    #DBEAFE;
  --primary-200:    #BFDBFE;

  /* Acento */
  --accent:         #06B6D4;
  --accent-50:      #ECFEFF;
  --accent-100:     #CFFAFE;

  /* Semânticas */
  --success:        #10B981;
  --success-bg:     #D1FAE5;
  --warning:        #F59E0B;
  --warning-bg:     #FEF3C7;
  --danger:         #EF4444;
  --danger-bg:      #FEE2E2;
  --info:           #3B82F6;
  --info-bg:        #EFF6FF;

  /* Neutros */
  --white:          #FFFFFF;
  --gray-50:        #F8FAFC;
  --gray-100:       #F1F5F9;
  --gray-200:       #E2E8F0;
  --gray-300:       #CBD5E1;
  --gray-400:       #94A3B8;
  --gray-500:       #64748B;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1E293B;
  --gray-900:       #0F172A;

  /* Layout */
  --sidebar-w:      264px;
  --header-h:       64px;

  /* Forma */
  --radius-xs:      4px;
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  /* Sombras */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.07), 0 10px 10px -5px rgba(0,0,0,.03);
  --shadow-xl:  0 25px 50px -12px rgba(0,0,0,.15);

  /* Transições */
  --t-fast:  .15s ease;
  --t:       .2s ease;
  --t-slow:  .3s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}
a { color: var(--primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ════════════════════════════════════════════════════════
   PÁGINAS DE AUTENTICAÇÃO
════════════════════════════════════════════════════════ */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: var(--white);
}

/* Painel esquerdo decorativo */
.auth-panel {
  background: linear-gradient(145deg, #1E40AF 0%, #2563EB 45%, #06B6D4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-panel::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -150px; right: -150px;
}
.auth-panel::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -80px; left: -80px;
}

.auth-panel-content { position: relative; z-index: 1; text-align: center; color: var(--white); }

.auth-logo-big {
  width: 80px; height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 0 auto 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}

.auth-panel-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.5px;
  margin-bottom: 12px;
}

.auth-panel-sub {
  font-size: 16px;
  opacity: .8;
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto 36px;
}

.auth-features { text-align: left; display: inline-flex; flex-direction: column; gap: 14px; }
.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: .9;
}
.auth-feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* Painel direito - formulário */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}

.auth-box {
  width: 100%;
  max-width: 380px;
}

.auth-box-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-box-logo .logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.auth-box-logo .logo-text { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.auth-box-logo .logo-text span { color: var(--primary); }

.auth-heading { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.auth-subheading { font-size: 14px; color: var(--gray-500); margin-bottom: 28px; }

/* Tabs de Login/Cadastro */
.auth-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--t);
}
.auth-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ════════════════════════════════════════════════════════
   FORMULÁRIOS
════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--white);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-left: 40px; }
.input-with-icon .input-icon-el {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 5px; line-height: 1.5; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

/* ════════════════════════════════════════════════════════
   BOTÕES
════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  user-select: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
  transform: translateY(-1px);
  color: var(--white);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(37,99,235,.3); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-900); }

.btn-danger { background: var(--danger); color: var(--white); box-shadow: 0 2px 8px rgba(239,68,68,.25); }
.btn-danger:hover { background: #DC2626; color: var(--white); box-shadow: 0 4px 12px rgba(239,68,68,.35); transform: translateY(-1px); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; color: var(--white); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-50); }

.btn-xs  { padding: 5px 10px; font-size: 11px; border-radius: var(--radius-xs); gap: 4px; }
.btn-sm  { padding: 7px 14px; font-size: 12.5px; }
.btn-lg  { padding: 13px 24px; font-size: 15px; }
.btn-xl  { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL (sidebar + conteúdo)
════════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--t-slow);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Logo da sidebar */
.sidebar-logo {
  padding: 18px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.sidebar-logo .s-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37,99,235,.25);
}
.sidebar-logo .s-logo-name { font-size: 19px; font-weight: 800; color: var(--gray-900); letter-spacing: -.3px; }
.sidebar-logo .s-logo-name span { color: var(--primary); }
.sidebar-logo .s-logo-tag { font-size: 10px; color: var(--gray-400); font-weight: 500; letter-spacing: .05em; display: block; margin-top: 1px; text-transform: uppercase; }

/* Navegação */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-400);
  padding: 12px 8px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--t-fast);
  margin-bottom: 1px;
  position: relative;
  text-decoration: none;
}
.nav-link:hover { background: var(--primary-50); color: var(--primary); }
.nav-link.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-link .ni { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; line-height: 1; }
.nav-link .nb {
  margin-left: auto;
  background: var(--primary);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* Footer da sidebar */
.sidebar-footer {
  border-top: 1px solid var(--gray-100);
  padding: 12px 10px;
  flex-shrink: 0;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: default;
}
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--gray-800); line-height: 1.3; }
.user-role { font-size: 11px; color: var(--gray-500); }
.logout-link {
  margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  color: var(--gray-400);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.logout-link:hover { background: var(--danger-bg); color: var(--danger); }
.logout-link svg { display: block; }

/* ── Conteúdo principal ── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.topbar-toggle:hover { background: var(--gray-100); }

.topbar-title { font-size: 17px; font-weight: 700; color: var(--gray-900); letter-spacing: -.2px; }
.topbar-sub { font-size: 12px; color: var(--gray-500); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Área de conteúdo ── */
.page-body { padding: 24px; flex: 1; }

/* Overlay mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
  backdrop-filter: blur(2px);
}

/* ════════════════════════════════════════════════════════
   CARDS
════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.card-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════
   STATS
════════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.si-blue   { background: var(--primary-100); }
.si-green  { background: var(--success-bg); }
.si-orange { background: var(--warning-bg); }
.si-purple { background: #EDE9FE; }
.si-red    { background: var(--danger-bg); }
.si-cyan   { background: var(--accent-100); }
.stat-value { font-size: 26px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 3px; font-weight: 500; }

/* ════════════════════════════════════════════════════════
   GRID DE ATIVIDADES
════════════════════════════════════════════════════════ */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.activity-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.activity-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.ac-thumb {
  height: 150px;
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--accent-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.ac-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ac-thumb-placeholder { font-size: 48px; line-height: 1; }
.ac-ia-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(37,99,235,.9);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  letter-spacing: .02em;
}

.ac-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ac-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  padding: 3px 9px;
  border-radius: 20px;
  width: fit-content;
}
.ac-title { font-size: 14px; font-weight: 700; color: var(--gray-900); line-height: 1.4; }
.ac-desc {
  font-size: 12.5px;
  color: var(--gray-500);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ac-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ac-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.ac-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ac-date { font-size: 11px; color: var(--gray-400); }
.ac-actions { display: flex; gap: 4px; }
.ac-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--gray-600);
  text-decoration: none;
  line-height: 1;
}
.ac-btn:hover          { background: var(--gray-100); border-color: var(--gray-300); }
.ac-btn.view:hover     { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary); }
.ac-btn.edit:hover     { background: var(--warning-bg); border-color: #FDE68A; color: var(--warning); }
.ac-btn.pdf:hover      { background: var(--success-bg); border-color: #A7F3D0; color: var(--success); }
.ac-btn.del:hover      { background: var(--danger-bg); border-color: #FECACA; color: var(--danger); }

/* ════════════════════════════════════════════════════════
   FILTROS
════════════════════════════════════════════════════════ */
.filters-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.filters-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap .form-control { padding-left: 36px; }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gray-400);
  line-height: 1;
}
.filter-select { width: auto; min-width: 180px; }

/* ════════════════════════════════════════════════════════
   BOX DE IA
════════════════════════════════════════════════════════ */
.ai-box {
  background: linear-gradient(135deg, #EFF6FF 0%, #ECFEFF 100%);
  border: 1.5px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.ai-box::after {
  content: '✨';
  position: absolute;
  right: 20px; top: -8px;
  font-size: 64px;
  opacity: .07;
  transform: rotate(15deg);
  pointer-events: none;
}
.ai-box-title { font-size: 17px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.ai-box-desc  { font-size: 13px; color: var(--gray-600); margin-bottom: 16px; line-height: 1.5; }

.ai-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.6;
}
.ai-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ai-textarea::placeholder { color: var(--gray-400); }

.ai-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ai-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--primary-200);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--t-fast);
}
.ai-chip:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ════════════════════════════════════════════════════════
   VISUALIZADOR DE ATIVIDADE
════════════════════════════════════════════════════════ */
.viewer-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: var(--white);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.viewer-hero::after {
  content: '🎓';
  position: absolute;
  right: 28px; top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  opacity: .15;
  pointer-events: none;
}
.viewer-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  backdrop-filter: blur(6px);
}
.viewer-hero h1 { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 10px; letter-spacing: -.3px; }
.viewer-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; opacity: .85; }
.viewer-meta-item { display: flex; align-items: center; gap: 5px; }

.viewer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}

.viewer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.section-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.8;
  white-space: pre-wrap;
}
.section-box.for-child {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-50) 100%);
  border-color: var(--primary-200);
}
.section-box.for-child .section-label { color: var(--primary-hover); }
.section-box.tips {
  background: var(--warning-bg);
  border-color: #FDE68A;
}
.section-box.tips .section-label { color: #B45309; }

.img-box {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-box img { width: 100%; height: auto; object-fit: contain; }
.img-placeholder {
  text-align: center;
  padding: 32px;
  color: var(--gray-400);
}
.img-placeholder .ip-icon { font-size: 40px; margin-bottom: 8px; }
.img-placeholder p { font-size: 12px; line-height: 1.5; }

/* ════════════════════════════════════════════════════════
   ALERTAS
════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-icon { font-size: 16px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border-color: #A7F3D0; color: #065F46; }
.alert-error   { background: var(--danger-bg);  border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--warning-bg); border-color: #FDE68A; color: #92400E; }
.alert-info    { background: var(--primary-50); border-color: var(--primary-200); color: #1E40AF; }

/* ════════════════════════════════════════════════════════
   BADGES & TAGS
════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-blue   { background: var(--primary-100); color: var(--primary-hover); }
.badge-green  { background: var(--success-bg); color: #065F46; }
.badge-orange { background: var(--warning-bg); color: #92400E; }
.badge-red    { background: var(--danger-bg);  color: #991B1B; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ════════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
}
.empty-state .es-icon { font-size: 52px; line-height: 1; margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; color: var(--gray-500); max-width: 340px; margin: 0 auto 20px; line-height: 1.7; }

/* ════════════════════════════════════════════════════════
   PAGINAÇÃO
════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  padding: 0 10px;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--white); font-weight: 700; }
.page-btn:disabled { opacity: .4; pointer-events: none; }
.page-info { font-size: 12px; color: var(--gray-400); padding: 0 8px; }

/* ════════════════════════════════════════════════════════
   SPINNER / LOADING
════════════════════════════════════════════════════════ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-dark { border-color: var(--gray-200); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.full-loader {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.full-loader .fl-icon { font-size: 36px; margin-bottom: 14px; animation: pulse 1.2s ease-in-out infinite; }
.full-loader p { font-size: 14px; font-weight: 600; color: var(--primary); }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.12);opacity:.75} }

/* ════════════════════════════════════════════════════════
   UTILITÁRIOS
════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--gray-200); margin: 20px 0; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ════════════════════════════════════════════════════════
   RESPONSIVO
════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .viewer-grid { grid-template-columns: 1fr; }
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-form-panel { padding: 32px 24px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .main-wrap { margin-left: 0; }
  .topbar-toggle { display: flex; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .activities-grid { grid-template-columns: 1fr; }
  .filters-row { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: 100%; }
  .filter-select { width: 100%; }
  .viewer-actions { gap: 8px; }
  .viewer-hero { padding: 20px; }
  .viewer-hero h1 { font-size: 19px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .auth-form-panel { padding: 24px 16px; }
}

/* ════════════════════════════════════════════════════════
   IMPRESSÃO / PDF
════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .viewer-actions,
  .sidebar-backdrop, .btn, .filters-wrap { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  body { background: white !important; }
  .card, .section-box { box-shadow: none !important; border: 1px solid #ddd !important; }
}