{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

    @template block_mwa_dashboard/content_analysis
    @copyright 2026 Bruno Porto
    @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
}}
<div style="display:flex;align-items:center;gap:.6rem;margin-bottom:1rem;">
  <span style="font-size:1.3rem;">🧩</span>
  <span style="font-size:.85rem;color:var(--muted);">{{updated}}</span>
</div>
<div class="kpi-row" style="margin-bottom:1.25rem;">{{{kpishtml}}}</div>
<div class="grid-2" style="margin-bottom:1.25rem;">
  <div class="card">
    <div class="card-head"><span class="card-title">🔥 {{stucktitle}}</span></div>
    {{{stuckhtml}}}
    <div style="padding:.6rem 1rem;font-size:.7rem;color:var(--muted);">% = {{stucknote}}</div>
  </div>
  <div class="card">
    <div class="card-head"><span class="card-title">📦 {{lowtitle}}</span></div>
    {{{lowhtml}}}
  </div>
</div>
<div class="card" style="margin-bottom:1.25rem;">
  <div class="card-head">
    <span class="card-title" style="background:linear-gradient(135deg,#a78bfa,#4f8ef7);-webkit-background-clip:text;-webkit-text-fill-color:transparent;">✨ {{aititle}}</span>
    <button id="btnRefreshContent" style="display:none;margin-left:auto;background:var(--panel2);border:1px solid var(--line2);border-radius:8px;padding:4px 12px;font-size:.75rem;cursor:pointer;color:var(--muted);">🔄 {{refresh}}</button>
  </div>
  <div id="prescriptiveIA" style="padding:1.25rem;">
    <div style="display:flex;flex-direction:column;align-items:center;gap:1rem;text-align:center;">
      <div style="font-size:2.5rem;">🤖</div>
      <div style="font-size:.85rem;color:var(--muted);max-width:460px;line-height:1.6;">{{aidesc}}</div>
      <button id="btnGenerateContent" style="background:linear-gradient(135deg,#a78bfa,#4f8ef7);color:#fff;border:none;padding:.65rem 1.5rem;border-radius:var(--radius-xl);font-size:.85rem;font-weight:700;cursor:pointer;">✨ {{generate}}</button>
    </div>
  </div>
</div>
<div class="card">
  <div class="card-head">
    <span class="card-title">📊 {{tabletitle}}</span>
    <span style="font-size:.7rem;color:var(--muted);margin-left:auto;">{{total}} {{studentstotal}}</span>
  </div>
  <div style="padding:.25rem 0;">
    <div style="display:flex;align-items:center;gap:.75rem;padding:.35rem 1rem;border-bottom:1px solid var(--line);font-size:.65rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;">
      <div style="width:110px;flex-shrink:0;">{{typehead}}</div>
      <div style="flex:1;">{{resourcehead}}</div>
      <div style="width:170px;flex-shrink:0;text-align:center;">{{coveragehead}}</div>
      <div style="width:80px;flex-shrink:0;text-align:right;">{{missinghead}}</div>
    </div>
    {{{tablerows}}}
  </div>
</div>
