/* ==========================================================================
   1. GERAL E VARIÁVEIS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Paleta de Cores */
  --bg: #080a0e;
  --panel: #0f1318;
  --panel-2: #0c0f14;
  --panel-hover: #141921;
  --ink: #e7eef7;
  --muted: #a5b3c6;
  --muted-2: #6b7a8f;
  --brand: #6cc4ff;
  --brand-2: #9966ff;
  --brand-glow: rgba(108, 196, 255, 0.15);
  --brand-2-glow: rgba(153, 102, 255, 0.15);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(108, 196, 255, 0.3);

  /* Cores por Categoria */
  --category-default-color: #e8edf7;
  --category-comunicacao-color: #a7f3d0;
  --category-juridico-color: #ddd6fe;
  --category-gestao-color: #bfdbfe;
  --category-contratacao-color: #fed7aa;
  --category-engenharia-ia-color: #c7d2fe;

  /* Tipografia */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Efeitos e Transições */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-brand: 0 0 32px rgba(108, 196, 255, 0.12);
  --transition: 0.23s cubic-bezier(.4,0,.2,1);
  --transition-slow: 0.45s cubic-bezier(.4,0,.2,1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* ── LIGHT MODE ──────────────────────────────────────────────────────────── */
body.light-mode {
  --bg: #f0f4f9;
  --panel: #ffffff;
  --panel-2: #e8eef6;
  --panel-hover: #f7fafd;
  --ink: #0d1520;
  --muted: #5b6b80;
  --muted-2: #8899aa;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(108, 196, 255, 0.5);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.14);
  --shadow-brand: 0 0 32px rgba(108, 196, 255, 0.1);
  --brand-glow: rgba(108, 196, 255, 0.1);
}

/* ==========================================================================
   2. BASE & FUNDO
   ========================================================================== */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Textura de fundo sutil */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108, 196, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(153, 102, 255, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

body.light-mode {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108, 196, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(153, 102, 255, 0.05) 0%, transparent 50%);
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); }

/* ── SCROLLBAR CUSTOMIZADA ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
* { scrollbar-width: thin; scrollbar-color: var(--brand) transparent; }

/* ==========================================================================
   3. LAYOUT PRINCIPAL
   ========================================================================== */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 20px;
  /* Linha decorativa inferior */
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

header img {
  height: 48px;
  width: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--border-color), var(--shadow-brand);
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  letter-spacing: -1px;
  margin: 0;
  background: linear-gradient(135deg, var(--ink) 30%, var(--brand));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light-mode .title {
  background: linear-gradient(135deg, #0d1520 30%, var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  color: var(--muted);
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.main-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-grow: 1;
}

/* ==========================================================================
   4. BARRA LATERAL E NAVEGAÇÃO
   ========================================================================== */
.sidebar { display: none; }

.category-list { list-style: none; padding: 0; margin: 0; }

.category-list button {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.category-list button:hover {
  background: var(--panel-hover);
  color: var(--ink);
}

.category-list button.active {
  color: var(--brand);
  background: var(--brand-glow);
  border-left: 2px solid var(--brand);
  font-weight: 600;
}

/* ==========================================================================
   5. BARRA DE FERRAMENTAS E FILTROS
   ========================================================================== */
.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 28px;
}

.search {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.search svg { color: var(--muted-2); flex-shrink: 0; transition: color var(--transition); }

.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow), var(--shadow-brand);
}

.search:focus-within svg { color: var(--brand); }

.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-body);
}

.search input::placeholder { color: var(--muted-2); }

.category-select-wrapper { display: block; }

#category-select {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font-body);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7a8f' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.7rem center;
  background-repeat: no-repeat;
  background-size: 1.4em 1.4em;
  transition: border-color var(--transition);
}

#category-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ==========================================================================
   6. GRELHA E CARTÕES (CARDS)
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── CARD BASE ────────────────────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Animação de entrada escalonada */
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Brilho interno sutil */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

/* Reflexo superior */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover), var(--shadow-brand);
  border-color: var(--border-hover);
  background: var(--panel-hover);
}

/* Delays escalonados por posição */
.card:nth-child(1)  { animation-delay: 0.04s; }
.card:nth-child(2)  { animation-delay: 0.08s; }
.card:nth-child(3)  { animation-delay: 0.12s; }
.card:nth-child(4)  { animation-delay: 0.16s; }
.card:nth-child(5)  { animation-delay: 0.20s; }
.card:nth-child(6)  { animation-delay: 0.24s; }
.card:nth-child(7)  { animation-delay: 0.28s; }
.card:nth-child(8)  { animation-delay: 0.32s; }
.card:nth-child(n+9) { animation-delay: 0.36s; }

/* ── CARD BODY ────────────────────────────────────────────────────────────── */
.card .head { display: flex; align-items: center; gap: 12px; }

.card .icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(108, 196, 255, 0.2));
  flex-shrink: 0;
}

.card .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.card .desc {
  color: var(--muted);
  font-size: 13px;
  min-height: 3.6em;
  flex-grow: 1;
  line-height: 1.55;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.grow { flex: 1; }

/* ── CARDS POR CATEGORIA (borda colorida) ──────────────────────────────── */
.card[data-category="comunicacao"] { border-color: rgba(167, 243, 208, 0.25); }
.card[data-category="juridico"]    { border-color: rgba(221, 214, 254, 0.25); }
.card[data-category="gestao"]      { border-color: rgba(191, 219, 254, 0.25); }
.card[data-category="contratacao"] { border-color: rgba(254, 215, 170, 0.25); }

.card[data-category="comunicacao"]:hover { border-color: rgba(167, 243, 208, 0.6); }
.card[data-category="juridico"]:hover    { border-color: rgba(221, 214, 254, 0.6); }
.card[data-category="gestao"]:hover      { border-color: rgba(191, 219, 254, 0.6); }
.card[data-category="contratacao"]:hover { border-color: rgba(254, 215, 170, 0.6); }

/* ── PILLS ────────────────────────────────────────────────────────────────── */
.pill, .card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.pill { color: #111; }
.pill.comunicacao  { background: var(--category-comunicacao-color); }
.pill.juridico     { background: var(--category-juridico-color); }
.pill.gestao       { background: var(--category-gestao-color); }
.pill.contratacao  { background: var(--category-contratacao-color); }

/* ── BOTÕES ───────────────────────────────────────────────────────────────── */
.btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 20px rgba(108, 196, 255, 0.35);
}

.btn:hover::after { opacity: 1; }

.btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn.outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 12px var(--brand-glow);
  transform: none;
}

/* Botão no card */
.card .btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-color);
  font-size: 11px;
  padding: 5px 12px;
}

.card .btn:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(108, 196, 255, 0.3);
  transform: none;
}

/* ==========================================================================
   7. SECÇÕES ADICIONAIS (PRÊMIO, MATERIAIS, RODAPÉ)
   ========================================================================== */

/* ── AWARD CARD ───────────────────────────────────────────────────────────── */
.award-card {
  margin: 48px 0;
  padding: 28px 32px;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--panel), var(--gold) 4%) 0%,
    var(--panel) 100%
  );
  border: 1px solid color-mix(in oklab, var(--gold), transparent 70%);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 60px var(--gold-glow);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.5s forwards;
  transition: transform var(--transition);
  position: relative;
  overflow: hidden;
}

.award-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.award-card:hover { transform: translateY(-4px); }

.award-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
  # animation: float 3s ease-in-out infinite;
}

.award-text h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.award-text p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.award-card .btn {
  background: var(--gold);
  color: #111;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
}

.award-card .btn:hover {
  background: var(--gold);
  filter: brightness(1.12);
  box-shadow: 0 4px 20px var(--gold-glow);
  transform: translateY(-1px);
}

/* ── MATERIAIS ────────────────────────────────────────────────────────────── */
.materials-container {
  margin-top: 40px;
  background: var(--panel);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.materials-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), transparent);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
  letter-spacing: -0.3px;
}

.materials-list { list-style: none; padding: 0; margin: 0; }

.materials-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color var(--transition);
}

.materials-list li:last-child { border-bottom: none; }

.materials-list a {
  color: var(--brand);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
}

.materials-list a:hover {
  color: color-mix(in oklab, var(--brand), #fff 25%);
  text-decoration: underline;
}

.material-audio-item { flex-wrap: wrap; }
.audio-player-wrapper { flex-grow: 1; }
.audio-player-wrapper p { margin: 0 0 8px; font-weight: 500; font-size: 14px; }
.audio-player-wrapper audio { width: 100%; height: 40px; }

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
footer {
  margin-top: 60px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.footer-links {
  margin: 12px 0;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted-2);
  text-decoration: underline dotted;
  transition: color var(--transition);
  font-size: 13px;
}

.footer-links a:hover { color: var(--brand); }
.copyright { font-size: 0.85em; opacity: 0.6; margin-top: 8px; }

/* ==========================================================================
   8. MODAIS
   ========================================================================== */
dialog#info-modal {
  width: min(680px, 92vw);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow-hover), 0 0 80px rgba(108, 196, 255, 0.08);
  max-height: 85vh;
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

dialog::backdrop {
  background: rgba(8, 10, 14, 0.8);
  backdrop-filter: blur(6px);
}

body.light-mode dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

#modal-content-area {
  padding: 20px 28px;
  max-height: calc(85vh - 80px);
  overflow-y: auto;
}

#modal-content-area h1 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 1rem; color: var(--ink); font-weight: 700; }
#modal-content-area h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; color: var(--muted); }
#modal-content-area a  { color: var(--brand); }
#modal-content-area ul, #modal-content-area ol { padding-left: 20px; line-height: 1.7; }

.modal-head {
  padding: 18px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(90deg, var(--brand-glow), transparent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border-color);
}

/* ── MODAL DE IMAGEM ──────────────────────────────────────────────────────── */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(8, 10, 14, 0.85);
  backdrop-filter: blur(10px);
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.image-modal.show { opacity: 1; }

.image-modal-content {
  position: relative;
  margin: auto;
  padding: 24px;
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  width: auto;
  max-width: 900px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-hover), 0 0 80px rgba(108, 196, 255, 0.1);
  transform: scale(0.93) translateY(10px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.image-modal.show .image-modal-content { transform: scale(1) translateY(0); }

#modal-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.image-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: var(--panel-hover);
  border: 1px solid var(--border-color);
  color: var(--muted);
  font-size: 20px;
  font-weight: bold;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  z-index: 10;
  line-height: 1;
}

.image-modal-close:hover {
  background: var(--brand-glow);
  color: var(--brand);
  border-color: var(--brand);
}

.image-modal-caption { padding: 16px 0 0; text-align: left; }
.image-modal-caption h4 {
  font-family: var(--font-display);
  color: var(--gold);
  margin: 0 0 6px;
  font-weight: 700;
}
.image-modal-caption p { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.5; }

/* ==========================================================================
   9. ESTADOS E UTILITÁRIOS
   ========================================================================== */
.loader {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.empty, .error {
  display: none;
  background: var(--panel-2);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   10. ANIMAÇÕES
   ========================================================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ==========================================================================
   11. BOTÃO DE TEMA (MODO DIA/NOITE)
   ========================================================================== */
.theme-toggle-btn {
  background: var(--panel);
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-glow);
  box-shadow: 0 0 16px var(--brand-glow);
}

.theme-toggle-btn .sun-icon,
.theme-toggle-btn .moon-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover .sun-icon,
.theme-toggle-btn:hover .moon-icon {
  transform: rotate(20deg) scale(1.1);
}

body:not(.light-mode) .sun-icon { display: none; }
body.light-mode .moon-icon { display: none; }

/* ==========================================================================
   12. RESPONSIVIDADE
   ========================================================================== */
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .main-layout { flex-direction: row; align-items: flex-start; }
  .sidebar {
    display: block;
    flex-shrink: 0;
    width: 220px;
    position: sticky;
    top: 20px;
    background: var(--panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 16px 12px;
    box-shadow: var(--shadow);
  }
  .toolbar { grid-template-columns: 1fr; }
  .category-select-wrapper { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ==========================================================================
   13. GRID DINÂMICO
   ========================================================================== */
@media (min-width: 992px) {
  .grid[data-card-count="3"] { grid-template-columns: repeat(3, 1fr); }
  .grid[data-card-count="2"] { grid-template-columns: repeat(2, 1fr); }
  .grid[data-card-count="1"] { grid-template-columns: repeat(1, 1fr); max-width: 420px; }
}

/* ==========================================================================
   14. ACESSIBILIDADE
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}
