/* Tema compartilhado — Controle ED + Analytics.
   Light é o padrão novo; dark continua disponível via toggle (persistido em localStorage).
   Variáveis idênticas às já usadas nos <style> de cada página — só os VALORES mudam por tema. */

:root {
  --bg:#eef0f2;
  --surface:#e6e9ed;
  --surface-2:#d8dde3;
  --line:#c9ced5;
  --line-soft:#d6dbe1;
  --text:#0c0d0f;
  --muted:#5f636b;
  --dim:#9aa0a8;
  --blue:#00c9a0;
  --blue-soft:#d7f3e7;
  --amber:#fbbf5c;
  --amber-soft:#fdf0da;
  --green:#047857;
  --green-soft:#d7f3e7;
  --red:#ff7b74;
  --red-soft:#fbdeda;
  --inset:#dde1e6;
  --shadow:0 12px 40px rgba(15,23,42,.12);
  --radius:16px;
  --glass-bg:rgba(255,255,255,.72);
  --glass-border:rgba(255,255,255,.9);
  --glass-shadow:0 12px 40px rgba(24,32,44,.12), inset 0 1px 0 rgba(255,255,255,.8);
}

/* Fallback só pra pintura inicial sem flash, antes do script de tema decidir —
   quando não há preferência salva E o SO pede dark. O atributo data-theme (setado
   cedo, ver script inline) sempre manda quando presente. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#0d0f16;
    --surface:#171a23;
    --surface-2:#1f2430;
    --line:#2b3140;
    --line-soft:#222734;
    --text:#f1f4f9;
    --muted:#97a1b2;
    --dim:#6b7280;
    --blue:#00e6b2;
    --blue-soft:#0f2c22;
    --amber:#fbbf5c;
    --amber-soft:#2f2713;
    --green:#00e6b2;
    --green-soft:#0f2c22;
    --red:#ff7b74;
    --red-soft:#331c1f;
    --inset:#0b1118;
    --shadow:0 12px 40px rgba(0,0,0,.32);
    --glass-bg:rgba(23,26,35,.66);
    --glass-border:rgba(255,255,255,.08);
    --glass-shadow:0 12px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
  }
}

:root[data-theme="dark"] {
  --bg:#0d0f16;
  --surface:#171a23;
  --surface-2:#1f2430;
  --line:#2b3140;
  --line-soft:#222734;
  --text:#f1f4f9;
  --muted:#97a1b2;
  --dim:#6b7280;
  --blue:#00e6b2;
  --blue-soft:#0f2c22;
  --amber:#fbbf5c;
  --amber-soft:#2f2713;
  --green:#00e6b2;
  --green-soft:#0f2c22;
  --red:#ff7b74;
  --red-soft:#331c1f;
  --inset:#0b1118;
  --shadow:0 12px 40px rgba(0,0,0,.32);
  --glass-bg:rgba(23,26,35,.66);
  --glass-border:rgba(255,255,255,.08);
  --glass-shadow:0 12px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ---- Liquid glass (idêntico ao ~/IACOM/mentoria, app/globals.css) ---- */
.liquid-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---- Ícones inline (usados pelo helper JS `icone()`) ---- */
.ic { display:inline-block; vertical-align:-2px; flex-shrink:0; }

/* ---- Toggle de tema (sol/lua) ---- */
.theme-toggle {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:8px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--text);
  cursor:pointer;
}
.theme-toggle:hover { border-color:var(--muted); }
.theme-toggle .ic-moon { display:none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display:none; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display:inline-block; }

/* ---- Ícones puramente decorativos que ainda vivem em CSS (::before/::after) ---- */
.search::before {
  content:'';
  position:absolute; left:11px; top:9px;
  width:15px; height:15px;
  background-color:var(--muted);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center / contain;
}
#logsBtn::after {
  content:''; display:inline-block; width:15px; height:15px; margin-left:2px;
  background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='6' x2='20' y2='6'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cline x1='4' y1='18' x2='20' y2='18'/%3E%3C/svg%3E") no-repeat center / contain;
  vertical-align:-3px;
}
#refreshBtn::after {
  content:''; display:inline-block; width:16px; height:16px;
  background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8'/%3E%3Cpath d='M21 3v5h-5'/%3E%3C/svg%3E") no-repeat center / contain;
  vertical-align:-3px;
}
/* Placeholder de capa quebrada (onerror da <img>, sem JS pra evitar quebrar o atributo HTML) */
.modelo-capa-erro::after {
  content:''; display:block; width:22px; height:22px; margin:auto;
  background-color:var(--muted);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.9-4.9c1.1-.4 2.2.2 2.6 1.3Z'/%3E%3Cpath d='m6.2 5.3 3.1 5.4'/%3E%3Cpath d='m12.4 3.4 3.1 5.4'/%3E%3Cpath d='M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.9-4.9c1.1-.4 2.2.2 2.6 1.3Z'/%3E%3Cpath d='m6.2 5.3 3.1 5.4'/%3E%3Cpath d='m12.4 3.4 3.1 5.4'/%3E%3Cpath d='M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3C/svg%3E") no-repeat center / contain;
}
#formatoBtn::after {
  content:''; display:inline-block; width:17px; height:17px; margin-left:2px;
  background-color:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.9-4.9c1.1-.4 2.2.2 2.6 1.3Z'/%3E%3Cpath d='m6.2 5.3 3.1 5.4'/%3E%3Cpath d='m12.4 3.4 3.1 5.4'/%3E%3Cpath d='M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.9-4.9c1.1-.4 2.2.2 2.6 1.3Z'/%3E%3Cpath d='m6.2 5.3 3.1 5.4'/%3E%3Cpath d='m12.4 3.4 3.1 5.4'/%3E%3Cpath d='M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/%3E%3C/svg%3E") no-repeat center / contain;
  vertical-align:-3px;
}
