    :root {
      /* Nova Paleta Tropical Study Vector */
      --bg-main: #F8F7F4;
      --bg-soft: #FFFDF8;
      --text-main: #1F3D4A;
      --text-soft: #4F6B75;

      --blue-main: #2F80ED;
      --blue-deep: #1D4E89;
      --teal-main: #2A9D8F;
      --mint-main: #9ADBCB;
      --mustard-main: #E9B949;
      --orange-main: #F39C5E;
      --coral-main: #EE7C73;
      --cream-main: #F6E7C8;

      /* Mapeamento de variáveis existentes */
      --bg-color: var(--bg-main);
      --paper-bg: var(--bg-soft);
      --text-heading: var(--blue-deep);
      --text-muted: var(--text-soft);

      --primary: var(--blue-main);
      --primary-hover: var(--blue-deep);
      --secondary: var(--teal-main);
      --secondary-hover: #1d8276;
      --accent: var(--orange-main);
      --accent-hover: #df8044;

      --border: #E8E5DF; /* Borda bege muito suave baseada no bg-main */
      --input-bg: #FFFFFF;

      /* Border radius mais amigáveis / arredondados */
      --radius-lg: 32px;
      --radius-md: 20px;
      --radius-sm: 12px;
    }

    * { box-sizing: border-box; }

    body {
      font-family: 'Nunito', 'Inter', system-ui, sans-serif;
      margin: 0;
      background: var(--bg-main);
      min-height: 100vh;
      color: var(--text-main);
      line-height: 1.6;
    }

    h1, h2, h3, h4 {
      font-family: 'Nunito', 'Inter', sans-serif;
      font-weight: 800;
      color: var(--text-heading);
      margin-top: 0;
      letter-spacing: -0.5px;
    }

    /* Antiga NavBar e Wrap removidos em favor do .app-layout e .page-container em base.html */

    .page-header {
      text-align: center;
      margin-bottom: 32px;
      background: var(--paper-bg);
      padding: 36px 28px;
      border-radius: var(--radius-lg);
      box-shadow: 0 12px 36px rgba(31, 61, 74, 0.05); /* Sombra mais orgânica */
      border-top: 8px solid var(--primary);
    }
    .page-header--left { text-align: left; }

    .page-header h1 { font-size: 2.2rem; margin-bottom: 8px; color: var(--primary); }
    .page-header .muted { font-size: 1.05rem; font-family: 'Nunito', sans-serif; color: var(--text-muted); font-weight: 600; }

    .header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }

    .header-actions {
      display: flex;
      gap: 12px;
      align-items: center;
      flex-wrap: wrap;
    }

    .title-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .title-row h1 { margin: 0; }

    .content-narrow {
      max-width: 860px;
      margin: 0 auto;
    }

    .header-illust {
      width: 160px;
      max-width: 38vw;
      height: auto;
      object-fit: contain;
      flex-shrink: 0;
      opacity: 0.95;
    }

    /* --- Stepper (Professor flow) --- */
    .stepper {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 18px 0 26px;
      flex-wrap: wrap;
      justify-content: center;
    }
    .step {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--paper-bg);
      color: var(--text-muted);
      font-weight: 800;
      font-family: 'Nunito', 'Inter', sans-serif;
      font-size: 0.92rem;
    }
    .step.is-active {
      color: var(--text-heading);
      border-color: rgba(47, 128, 237, 0.35);
      box-shadow: 0 10px 24px rgba(31, 61, 74, 0.06);
    }
    .step.is-done {
      color: #166534;
      border-color: #bbf7d0;
      background: #dcfce7;
    }
    .step-num {
      width: 30px;
      height: 30px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-color);
      color: var(--text-heading);
      border: 1px solid var(--border);
      font-size: 0.9rem;
      flex-shrink: 0;
    }
    .step.is-active .step-num {
      background: rgba(47, 128, 237, 0.12);
      border-color: rgba(47, 128, 237, 0.35);
      color: var(--primary);
    }
    .step.is-done .step-num {
      background: #bbf7d0;
      border-color: #86efac;
      color: #166534;
    }
    .step-sep {
      height: 2px;
      width: 40px;
      background: var(--border);
      border-radius: 99px;
      opacity: 0.75;
    }

    .help-list {
      margin: 0;
      padding-left: 18px;
    }
    .help-list li { margin-bottom: 10px; }
    .help-list li:last-child { margin-bottom: 0; }

    .questoes-container {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin-bottom: 1.5rem;
    }

    .loading-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 10px;
      margin-top: 1.5rem;
    }

    .select-note {
      font-weight: 800;
      color: var(--primary);
    }

    .m-0 { margin: 0; }
    .mb-10 { margin-bottom: 10px; }

    .card {
      background: var(--paper-bg);
      border-radius: var(--radius-lg);
      padding: 32px;
      border: 1px solid var(--border);
      box-shadow: 0 8px 32px rgba(31, 61, 74, 0.04);
      margin-bottom: 24px;
    }

    .empty-state {
      text-align: center;
      padding: 3rem 1.5rem;
      background: #f8fafc;
      border: 1px dashed var(--border);
      border-radius: var(--radius-md);
    }

    .fav-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: #f59e0b;
      padding: 0;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .fav-btn--sm { font-size: 1.5rem; }
    .fav-btn--lg { font-size: 2rem; }
    .fav-btn:focus-visible {
      outline: none;
      border-radius: 10px;
      box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
    }

    /* --- Compat (templates professor / estilo "bootstrap") --- */
    .container {
      width: 100%;
      max-width: 1000px;
      margin: 2rem auto;
      padding: 0 1rem;
    }

    .text-muted { color: var(--text-muted); }

    .form-control {
      width: 100%;
      display: block;
    }

    .table-responsive {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.92rem;
      background: var(--paper-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      overflow: hidden;
    }

    .table thead th {
      text-align: left;
      padding: 10px 14px;
      background: var(--bg-color);
      border-bottom: 2px solid var(--border);
      font-weight: 700;
      color: var(--text-heading);
      white-space: nowrap;
    }

    .table tbody td {
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }

    .table tbody tr:hover td { background: #fafafa; }

    h2 {
      font-size: 1.4rem;
      border-bottom: 2px solid var(--border);
      padding-bottom: 12px;
      margin-bottom: 24px;
      color: var(--text-heading);
    }

    .grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 28px;
    }

    .input-group { margin-bottom: 18px; }

    label {
      display: block;
      font-weight: 600;
      margin-bottom: 7px;
      color: var(--text-heading);
      font-size: 0.92rem;
    }

    textarea, input, select {
      width: 100%;
      padding: 12px 14px;
      border-radius: var(--radius-md);
      border: 1.5px solid var(--border);
      background-color: var(--input-bg);
      font-family: 'Inter', sans-serif;
      font-size: 1rem;
      color: var(--text-main);
      transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    }

    textarea:focus, input:focus, select:focus {
      outline: none;
      border-color: var(--primary);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
    }

    textarea { min-height: 110px; resize: vertical; }

    /* ── Buttons ───────────────────────────────────────────── */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--primary);
      color: white;
      border: 0;
      border-radius: 99px;
      padding: 14px 28px;
      cursor: pointer;
      font-weight: 800;
      font-size: 1.05rem;
      font-family: 'Nunito', 'Inter', sans-serif;
      text-decoration: none;
      transition: all 0.15s ease-in-out;
      gap: 10px;
      box-shadow: 0 4px 0 var(--primary-hover), 0 5px 10px rgba(99,102,241,0.2);
    }

    .btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--primary-hover), 0 10px 20px rgba(99,102,241,0.25); }
    .btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--primary-hover); }
    .btn:focus-visible {
      outline: none;
      box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.18), 0 4px 0 var(--primary-hover), 0 6px 16px rgba(47, 128, 237, 0.18);
    }
    .btn-submit { width: 100%; margin-top: 8px; padding: 16px; font-size: 1.15rem; }

    /* Variantes "bootstrap-like" (usadas em templates professor_*.html) */
    .btn-primary { background: var(--primary); box-shadow: 0 4px 0 var(--primary-hover), 0 5px 10px rgba(47, 128, 237, 0.2); }
    .btn-primary:hover { box-shadow: 0 6px 0 var(--primary-hover), 0 10px 20px rgba(47, 128, 237, 0.25); }
    .btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--primary-hover); }

    .btn-secondary { background: var(--secondary); box-shadow: 0 4px 0 var(--secondary-hover), 0 5px 10px rgba(16,185,129,0.2); }
    .btn-secondary:hover { box-shadow: 0 6px 0 var(--secondary-hover), 0 10px 20px rgba(16,185,129,0.25); }
    .btn-secondary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--secondary-hover); }

    .btn-info { background: #3b82f6; box-shadow: 0 4px 0 #1d4ed8, 0 5px 10px rgba(59,130,246,0.2); }
    .btn-info:hover { box-shadow: 0 6px 0 #1d4ed8, 0 10px 20px rgba(59,130,246,0.25); }
    .btn-info:active { transform: translateY(4px); box-shadow: 0 0 0 #1d4ed8; }

    .btn-outline-secondary {
      background: var(--paper-bg);
      color: var(--text-main);
      border: 2px solid var(--border);
      box-shadow: 0 4px 0 var(--border);
      font-weight: 700;
    }
    .btn-outline-secondary:hover { background: #f8fafc; border-color: #cbd5e1; box-shadow: 0 6px 0 #cbd5e1; transform: translateY(-2px); }
    .btn-outline-secondary:active { transform: translateY(4px); box-shadow: 0 0 0 #cbd5e1; }
    .btn-success { background: var(--secondary); box-shadow: 0 4px 0 var(--secondary-hover), 0 5px 10px rgba(16,185,129,0.2); }
    .btn-success:hover { box-shadow: 0 6px 0 var(--secondary-hover), 0 10px 20px rgba(16,185,129,0.25); }
    .btn-success:active { transform: translateY(4px); box-shadow: 0 0 0 var(--secondary-hover); }
    .btn-accent { background: var(--accent); box-shadow: 0 4px 0 var(--accent-hover), 0 5px 10px rgba(245,158,11,0.2); }
    .btn-accent:hover { box-shadow: 0 6px 0 var(--accent-hover), 0 10px 20px rgba(245,158,11,0.25); }
    .btn-accent:active { transform: translateY(4px); box-shadow: 0 0 0 var(--accent-hover); }
    .btn-danger { background: #ef4444; box-shadow: 0 4px 0 #b91c1c; }
    .btn-danger:hover { box-shadow: 0 6px 0 #b91c1c; }
    .btn-danger:active { transform: translateY(4px); box-shadow: 0 0 0 #b91c1c; }
    .btn-outline {
      background: var(--paper-bg);
      color: var(--text-main);
      border: 2px solid var(--border);
      box-shadow: 0 4px 0 var(--border);
      font-weight: 700;
    }
    .btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; box-shadow: 0 6px 0 #cbd5e1; transform: translateY(-2px); }
    .btn-outline:active { transform: translateY(4px); box-shadow: 0 0 0 #cbd5e1; }
    .btn-sm { padding: 8px 16px; font-size: 0.9rem; }

    /* ── Lesson Paper (original) ───────────────────────────── */
    .lesson-paper {
      background: #fff;
      padding: 50px 60px;
      border-radius: 4px;
      box-shadow: 0 10px 25px rgba(0,0,0,0.08);
      margin-top: 36px;
      position: relative;
    }

    .lesson-paper::before {
      content: '';
      position: absolute;
      top: 0; bottom: 0; left: 40px;
      width: 2px;
      background: #fecdd3;
      z-index: 0;
    }

    .lesson-content { position: relative; z-index: 1; }

    .lesson-paper h2 { text-align: center; font-size: 1.8rem; border: none; margin-bottom: 28px; }
    .lesson-paper h3 {
      font-size: 1.15rem;
      color: var(--primary);
      margin-top: 28px;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* ── Badges / Metrics ──────────────────────────────────── */
    .metrics {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 28px;
      justify-content: center;
    }

    .badge {
      background: #f1f5f9;
      color: var(--text-main);
      padding: 5px 13px;
      border-radius: 99px;
      font-size: 0.88rem;
      font-weight: 500;
      border: 1px solid var(--border);
      display: flex;
      gap: 5px;
    }

    .badge strong { color: var(--primary); }

    /* ── Highlight Boxes ───────────────────────────────────── */
    .highlight-box {
      background: #f8fafc;
      padding: 18px;
      border-radius: var(--radius-md);
      border-left: 4px solid var(--primary);
      margin: 14px 0;
    }

    .example-box {
      background: #f0fdf4;
      padding: 18px;
      border-radius: var(--radius-md);
      border-left: 4px solid var(--secondary);
      margin: 14px 0;
    }

    .alert-box {
      background: #fef2f2;
      padding: 14px;
      border-radius: var(--radius-md);
      border-left: 4px solid #ef4444;
      margin: 10px 0;
      color: #991b1b;
    }

    .quote-box {
      font-style: italic;
      background: #f8fafc;
      padding: 16px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      margin-bottom: 14px;
    }

    .choices {
      list-style: none;
      padding-left: 0;
      margin: 0 0 14px;
    }
    .choices li { margin-bottom: 6px; }

    .qa-field { margin-bottom: 12px; }
    .qa-field:last-child { margin-bottom: 0; }

    .qa-title { margin-bottom: 10px; }
    .stack-item { margin-top: 18px; }

    .list-spaced li { margin-bottom: 0.6rem; }
    .list-spaced li:last-child { margin-bottom: 0; }

    .page-footer-note {
      text-align: center;
      margin-top: 32px;
      padding-top: 18px;
      border-top: 1px solid var(--border);
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    /* ── Alerts / Status ───────────────────────────────────── */
    .status-bars { margin-bottom: 20px; }
    .alert {
      padding: 14px 18px;
      border-radius: var(--radius-md);
      margin-bottom: 10px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .alert-ok   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
    .alert-warn { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }

    /* ── History List ──────────────────────────────────────── */
    .history-list { list-style: none; padding: 0; }
    .history-list li {
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
    }
    .history-list a { color: var(--primary); text-decoration: none; font-weight: 500; }
    .history-list a:hover { text-decoration: underline; }

    .id-badge {
      background: var(--border);
      color: var(--text-muted);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.78rem;
      margin-right: 6px;
    }

    .muted { color: var(--text-muted); }
    .small { font-size: 0.85rem; }

    /* ── Download Actions ──────────────────────────────────── */
    .download-actions {
      margin-top: 36px;
      padding-top: 26px;
      border-top: 1px dashed var(--border);
      display: flex;
      gap: 14px;
      justify-content: center;
      flex-wrap: wrap;
    }

    /* ── Answer Cards (questão múltipla escolha) ────────────── */
    .answer-cards { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }

    .answer-card {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      padding: 14px 18px;
      border-radius: var(--radius-md);
      border: 2px solid var(--border);
      cursor: pointer;
      transition: all 0.15s;
      background: var(--paper-bg);
      user-select: none;
    }

    .answer-card:hover { border-color: var(--primary); background: #f5f3ff; }

    .answer-card.selected {
      border-color: var(--primary);
      background: #ede9fe;
    }

    .answer-card input[type="radio"] { display: none; }

    .answer-letter {
      min-width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--border);
      color: var(--text-heading);
      font-weight: 700;
      font-size: 0.9rem;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .answer-card.selected .answer-letter {
      background: var(--primary);
      color: white;
    }

    .answer-card.correct { border-color: var(--secondary); background: #f0fdf4; }
    .answer-card.correct .answer-letter { background: var(--secondary); color: white; }
    .answer-card.wrong { border-color: #dc2626; background: #fef2f2; }
    .answer-card.wrong .answer-letter { background: #dc2626; color: white; }

    /* ── Result Banner ─────────────────────────────────────── */
    .result-banner {
      padding: 24px 32px;
      border-radius: var(--radius-lg);
      margin-bottom: 28px;
      text-align: center;
    }

    .result-banner.acertou {
      background: #dcfce7;
      border: 2px solid #86efac;
      color: #14532d;
    }

    .result-banner.errou {
      background: #fef2f2;
      border: 2px solid #fca5a5;
      color: #7f1d1d;
    }

    .result-banner h2 {
      font-size: 1.8rem;
      margin-bottom: 6px;
      border: none;
    }

    /* ── Star Rating ───────────────────────────────────────── */
    .star-rating {
      display: flex;
      gap: 6px;
      justify-content: center;
      margin: 12px 0;
    }

    .star-rating button {
      background: none;
      border: none;
      font-size: 2rem;
      cursor: pointer;
      color: #d1d5db;
      transition: color 0.1s, transform 0.1s;
      padding: 0;
      line-height: 1;
    }

    .star-rating button:hover,
    .star-rating button.active { color: #f59e0b; transform: scale(1.15); }

    /* ── Timer ─────────────────────────────────────────────── */
    .timer-display {
      font-family: 'Inter', monospace;
      font-size: 0.9rem;
      color: var(--text-muted);
      text-align: right;
      margin-bottom: 8px;
    }

    /* ── User Navbar Badge (deprecated) ────────────────────── */
    .user-status-deprecated {
      display: flex;
      align-items: center;
    }

    /* ── Admin Table ───────────────────────────────────────── */
    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
    }

    .data-table th {
      text-align: left;
      padding: 10px 14px;
      background: var(--bg-color);
      border-bottom: 2px solid var(--border);
      font-weight: 600;
      color: var(--text-heading);
    }

    .data-table td {
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }

    .data-table tr:hover td { background: #fafafa; }

    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 99px;
      font-size: 0.78rem;
      font-weight: 600;
    }

    .tag-enem    { background: #dbeafe; color: #1e40af; }
    .tag-fuvest  { background: #fce7f3; color: #9d174d; }
    .tag-unicamp { background: #fef3c7; color: #92400e; }
    .tag-ia      { background: #ede9fe; color: #5b21b6; }
    .tag-manual  { background: #f1f5f9; color: #475569; }

    /* ── Stats Cards ───────────────────────────────────────── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }

    .stat-card {
      background: var(--paper-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 20px;
      text-align: center;
    }

    .stat-card .stat-value {
      font-size: 2.2rem;
      font-weight: 700;
      font-family: 'Lora', serif;
      color: var(--primary);
    }

    .stat-card .stat-label {
      font-size: 0.85rem;
      color: var(--text-muted);
      margin-top: 4px;
    }

    /* ── Filter Bar ────────────────────────────────────────── */
    .filter-bar {
      display: flex;
      gap: 12px;
      align-items: flex-end;
      flex-wrap: wrap;
      margin-bottom: 20px;
    }

    .filter-bar .input-group { margin: 0; flex: 1; min-width: 160px; }

    /* --- Professor: accordion de seleção de questões --- */
    .questao-card {
      border: 2px solid #e2e8f0;
      border-radius: 16px;
      background: #fff;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      margin-bottom: 1rem;
      overflow: hidden;
      cursor: pointer;
    }
    .questao-card-header {
      padding: 1.2rem;
      display: flex;
      gap: 1.2rem;
      align-items: flex-start;
    }
    .questao-card.expanded {
      border-color: var(--primary);
      background: #f8faff;
      box-shadow: 0 4px 12px rgba(108,71,255,0.1);
    }
    .enunciado-container {
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      transition: all 0.3s ease;
      font-size: 0.95rem;
      color: #475569;
      line-height: 1.6;
    }
    .expanded .enunciado-container {
      display: block;
      -webkit-line-clamp: unset;
      color: #1e293b;
    }
    .chevron-icon {
      transition: transform 0.3s ease;
      font-size: 1.2rem;
      color: #94a3b8;
      width: 44px;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      margin-top: -5px;
      flex-shrink: 0;
    }
    .expanded .chevron-icon {
      transform: rotate(180deg);
      background: #fff;
      color: var(--primary);
    }
    .badge-pill {
      padding: 4px 12px;
      border-radius: 99px;
      font-size: 0.72rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.02em;
      border: 1px solid var(--border);
    }
    .badge-pill--source { background: #eff6ff; color: #1e40af; }
    .badge-pill--subject { background: #f0fdf4; color: #166534; }
    .questao-tema { font-size: 0.85rem; color: #64748b; font-weight: 600; margin-left: 5px; }
    .questao-meta {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 0.8rem;
      gap: 12px;
    }
    .questao-meta-left { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
    .questao-content { flex: 1; }
    .questao-check-wrap { padding-top: 5px; }
    .questao-check {
      width: 22px;
      height: 22px;
      accent-color: var(--primary);
      cursor: pointer;
    }

    /* ── Avatar Utilities ──────────────────────────────────── */
    .avatar-sm,
    .avatar-md,
    .avatar-lg {
      border-radius: 50%;
      object-fit: cover;
      display: inline-block;
      flex-shrink: 0;
    }
    .avatar-sm { width: 32px; height: 32px; }
    .avatar-md { width: 48px; height: 48px; }
    .avatar-lg { width: 80px; height: 80px; }

    /* ── Card Variants ─────────────────────────────────────── */
    .card-primary { border-top: 4px solid var(--primary); }
    .card-success { border-top: 4px solid var(--secondary); }
    .card-accent  { border-top: 4px solid var(--accent); }
    .card-danger  { border-top: 4px solid #ef4444; }

    /* ── Page Title ─────────────────────────────────────────── */
    .page-title {
      text-align: center;
      font-family: 'Nunito', sans-serif;
      font-weight: 900;
      font-size: 2rem;
      color: var(--text-heading);
      margin-bottom: 8px;
    }
    .page-title .subtitle {
      display: block;
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-muted);
      margin-top: 4px;
    }

    /* ── Alert Error ───────────────────────────────────────── */
    .alert-error {
      background: #fef2f2;
      color: #991b1b;
      border: 1px solid #fca5a5;
      border-radius: 14px;
      padding: 14px 18px;
      margin-bottom: 10px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .alert { border-radius: 14px; }

    /* ── Auth Page Styles ──────────────────────────────────── */
    .auth-container {
      max-width: 440px;
      margin: 0 auto;
      padding: 40px 20px;
    }

    .auth-card {
      background: #fff;
      border-radius: var(--radius-md);
      padding: 36px 32px;
      box-shadow: 0 8px 32px rgba(47, 128, 237, 0.08), 0 2px 8px rgba(31, 61, 74, 0.04);
    }

    .auth-field {
      margin-bottom: 20px;
    }
    .auth-field label {
      display: block;
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--text-heading);
      font-size: 0.92rem;
    }
    .auth-field input {
      width: 100%;
      padding: 14px 16px;
      border-radius: var(--radius-sm);
      border: 1.5px solid var(--border);
      background: var(--input-bg);
      font-family: 'Inter', sans-serif;
      font-size: 1rem;
      color: var(--text-main);
      transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    }
    .auth-field input:focus {
      outline: none;
      border-color: var(--primary);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
    }

    .auth-submit {
      width: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--primary);
      color: white;
      border: 0;
      border-radius: 99px;
      padding: 16px 28px;
      cursor: pointer;
      font-weight: 800;
      font-size: 1.1rem;
      font-family: 'Nunito', 'Inter', sans-serif;
      text-decoration: none;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
      box-shadow: 0 4px 0 var(--primary-hover), 0 6px 16px rgba(47, 128, 237, 0.2);
      margin-top: 8px;
    }
    .auth-submit:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 0 var(--primary-hover), 0 12px 24px rgba(47, 128, 237, 0.25);
    }
    .auth-submit:active {
      transform: translateY(4px);
      box-shadow: 0 0 0 var(--primary-hover);
    }

    .auth-link {
      display: inline-block;
      color: var(--primary);
      font-weight: 600;
      font-size: 0.92rem;
      text-decoration: none;
      transition: color 0.2s ease;
    }
    .auth-link:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }

    .security-badge {
      text-align: center;
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-top: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    /* ── Responsive ────────────────────────────────────────── */
    @media (max-width: 1024px) {
      .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    }

    @media (max-width: 768px) {
      .grid { grid-template-columns: 1fr; }
      .lesson-paper { padding: 24px 16px; }
      .lesson-paper::before { display: none; }
      .download-actions { flex-direction: column; }
      .btn { width: 100%; }
      .filter-bar { flex-direction: column; }
      .filter-bar .input-group { min-width: 100%; }
      .stats-grid { grid-template-columns: 1fr 1fr; }
      .page-header { padding: 24px 16px; }
      .page-header h1 { font-size: 1.6rem; }
      .card { padding: 20px; }
      .auth-card { padding: 28px 20px; }
      .page-title { font-size: 1.6rem; }
    }

    @media (max-width: 480px) {
      .stats-grid { grid-template-columns: 1fr; }
      .metrics { gap: 6px; }
      .badge { font-size: 0.8rem; padding: 4px 10px; }
      .auth-container { padding: 24px 12px; }
      .auth-card { padding: 24px 16px; }
    }

    /* ═══════════════════════════════════════════════
       UI REFINADA — componentes editoriais v2
       Linguagem visual consistente: kicker + title + sub,
       cards com ícone contido, botões discretos.
    ═══════════════════════════════════════════════ */

    /* Kicker: etiqueta sutil acima do título */
    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 0.74rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--primary);
      margin-bottom: 10px;
    }
    .eyebrow::before {
      content: '';
      display: inline-block;
      width: 22px;
      height: 2px;
      background: currentColor;
      border-radius: 2px;
      opacity: 0.8;
    }
    .eyebrow--teal { color: var(--teal-main); }
    .eyebrow--orange { color: var(--orange-main); }
    .eyebrow--deep { color: var(--blue-deep); }

    /* Hero editorial (página interna) */
    .page-hero {
      position: relative;
      background: var(--paper-bg);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      padding: 36px 36px 34px;
      margin-bottom: 28px;
      box-shadow: 0 8px 32px rgba(31, 61, 74, 0.04);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 28px;
      flex-wrap: wrap;
      overflow: hidden;
    }
    .page-hero::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 4px;
      background: var(--hero-accent, var(--primary));
    }
    .page-hero--teal { --hero-accent: var(--teal-main); }
    .page-hero--orange { --hero-accent: var(--orange-main); }
    .page-hero--blue { --hero-accent: var(--blue-main); }

    .page-hero__body { flex: 1; min-width: 260px; }
    .page-hero__title {
      font-size: 2.1rem;
      line-height: 1.15;
      margin: 0 0 10px;
      color: var(--text-heading);
      letter-spacing: -0.5px;
    }
    .page-hero__sub {
      font-size: 1.02rem;
      color: var(--text-soft);
      line-height: 1.6;
      margin: 0;
      max-width: 560px;
    }
    .page-hero__art {
      width: 150px;
      flex-shrink: 0;
      opacity: 0.95;
    }
    .page-hero__art img { width: 100%; height: auto; object-fit: contain; }

    /* Flow steps (cards horizontais explicando um processo) */
    .flow-steps {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 14px;
      margin-bottom: 28px;
    }
    .flow-step {
      background: var(--paper-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px 20px;
      display: flex;
      gap: 14px;
      align-items: flex-start;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }
    .flow-step:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 28px rgba(31, 61, 74, 0.06);
    }
    .flow-step__num {
      width: 32px;
      height: 32px;
      border-radius: 10px;
      background: var(--bg-main);
      color: var(--text-heading);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      font-size: 0.92rem;
      flex-shrink: 0;
      border: 1px solid var(--border);
    }
    .flow-step__title {
      font-weight: 800;
      color: var(--text-heading);
      font-size: 0.95rem;
      margin: 2px 0 4px;
      line-height: 1.3;
    }
    .flow-step__desc {
      font-size: 0.85rem;
      color: var(--text-soft);
      line-height: 1.5;
      margin: 0;
    }

    /* Form section — seção numerada dentro de um card */
    .form-section + .form-section { margin-top: 28px; }
    .form-section__head {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 18px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    .form-section__num {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--section-color, var(--primary));
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 0.85rem;
      flex-shrink: 0;
    }
    .form-section__title {
      margin: 0;
      font-size: 1.05rem;
      color: var(--text-heading);
      font-weight: 800;
    }
    .form-section__title small {
      display: block;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--text-soft);
      margin-top: 2px;
    }

    /* Divisor "ou" */
    .or-divider {
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 8px 0 14px;
      color: var(--text-soft);
    }
    .or-divider::before, .or-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }
    .or-divider__label {
      font-size: 0.74rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.14em;
    }

    /* Hint box — nota informativa abaixo de formulários */
    .hint-box {
      background: linear-gradient(135deg, rgba(47,128,237,0.05), rgba(42,157,143,0.05));
      border: 1px solid rgba(47,128,237,0.15);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      font-size: 0.88rem;
      color: var(--text-soft);
      line-height: 1.55;
    }
    .hint-box strong { color: var(--text-heading); }
    .hint-box--orange {
      background: linear-gradient(135deg, rgba(243,156,94,0.06), rgba(233,185,73,0.06));
      border-color: rgba(243,156,94,0.2);
    }

    /* Aula list — cards de histórico */
    .aula-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .aula-row {
      display: flex;
      align-items: center;
      gap: 18px;
      background: var(--paper-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 18px 22px;
      transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }
    .aula-row:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 28px rgba(31, 61, 74, 0.06);
      border-color: rgba(47, 128, 237, 0.25);
    }
    .aula-row__fav {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 1.5rem;
      line-height: 1;
      padding: 4px;
      color: var(--border);
      transition: color 0.15s, transform 0.15s;
      flex-shrink: 0;
    }
    .aula-row__fav.is-active { color: #E9B949; }
    .aula-row__fav:hover { transform: scale(1.1); }
    .aula-row__main { flex: 1; min-width: 0; }
    .aula-row__tema {
      font-weight: 800;
      color: var(--text-heading);
      font-size: 1rem;
      margin-bottom: 6px;
      line-height: 1.3;
    }
    .aula-row__tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .chip {
      display: inline-flex;
      align-items: center;
      font-size: 0.76rem;
      font-weight: 700;
      border-radius: 99px;
      padding: 3px 10px;
      background: var(--bg-main);
      color: var(--text-soft);
      border: 1px solid var(--border);
    }
    .chip--blue { background: rgba(47,128,237,0.08); color: var(--blue-deep); border-color: rgba(47,128,237,0.2); }
    .chip--teal { background: rgba(42,157,143,0.08); color: var(--teal-main); border-color: rgba(42,157,143,0.2); }
    .aula-row__date {
      text-align: right;
      color: var(--text-soft);
      font-size: 0.82rem;
      flex-shrink: 0;
      line-height: 1.3;
    }
    .aula-row__date strong { display: block; color: var(--text-main); font-size: 0.88rem; font-weight: 700; }
    .aula-row__actions {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
      flex-wrap: wrap;
      overflow: visible;
    }
    .aula-row { overflow: visible; }

    /* Botão ícone (compacto) */
    .btn-icon {
      padding: 8px 14px;
      font-size: 0.84rem;
      border-radius: 10px;
      font-weight: 700;
      display: inline-flex;
      gap: 6px;
      align-items: center;
    }

    /* Empty state refinado */
    .empty-refined {
      text-align: center;
      padding: 64px 24px;
      background: var(--paper-bg);
      border: 1.5px dashed var(--border);
      border-radius: var(--radius-lg);
    }
    .empty-refined__icon {
      width: 72px; height: 72px;
      border-radius: 50%;
      background: var(--bg-main);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 2rem;
      margin-bottom: 16px;
    }
    .empty-refined h3 {
      color: var(--text-heading);
      margin: 0 0 8px;
      font-size: 1.2rem;
    }
    .empty-refined p {
      color: var(--text-soft);
      margin: 0 0 22px;
      font-size: 0.95rem;
    }

    /* Responsive refinements */
    @media (max-width: 720px) {
      .page-hero { padding: 26px 22px; }
      .page-hero__title { font-size: 1.65rem; }
      .page-hero__art { width: 110px; }
      .aula-row {
        flex-wrap: wrap;
        padding: 16px 18px;
      }
      .aula-row__date { text-align: left; width: 100%; }
      .aula-row__actions { width: 100%; }
    }
