* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--background);
  background-size: 34px 34px;
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: color-mix(in srgb, var(--surface-elevated) 93%, transparent);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  backdrop-filter: blur(14px);
  z-index: 20;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--primary); position: relative; flex: 0 0 auto;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(255,255,255,.82); border-radius: 50%;
}
.brand-mark::after { inset: 12px 5px; border-radius: 0; border-width: 0 0 1px 1px; transform: rotate(-45deg); }
.brand-text strong { display:block; letter-spacing:-.02em; }
.brand-text span { color: var(--text-muted); font-size: .78rem; }

.nav-label { padding: 14px 10px 6px; color: var(--text-muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.nav-link {
  display:flex; align-items:center; gap:10px; padding:10px 12px; margin:4px 0;
  border-radius: 9px; color: var(--text-secondary); cursor:pointer; border:1px solid transparent;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-link.active { background: var(--accent-soft); color: var(--primary); border-color: var(--border); font-weight: 750; }
.nav-dot { width:8px; height:8px; border-radius:50%; background:currentColor; opacity:.75; }
.sidebar-bottom { margin-top: 18px; border-top:1px solid var(--border); padding-top:12px; }

.main { min-width:0; }
.topbar {
  height:72px; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:0 28px; border-bottom:1px solid var(--border);
  background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(12px);
  position:sticky; top:0; z-index:15;
}
.topbar-title { font-weight:800; letter-spacing:-.02em; }
.top-actions { display:flex; gap:9px; align-items:center; }
.content { width:min(1160px, calc(100% - 48px)); margin:0 auto; padding:38px 0 70px; }

.hero {
  position:relative; overflow:hidden; padding:34px; border-radius:14px;
  background: var(--surface); border:1px solid var(--border);
  margin-bottom:28px;
}
.hero::after {
  content:""; position:absolute; width:210px; height:210px; border:1px solid var(--secondary);
  border-radius:50%; right:-45px; top:-80px; opacity:.5;
}
.hero-kicker { color:var(--primary); font-size:.78rem; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.hero h1 { margin:7px 0 6px; font-size:clamp(1.8rem, 4vw, 3rem); line-height:1.05; letter-spacing:-.045em; max-width:760px; }
.hero p { margin:0; color:var(--text-secondary); max-width:730px; }

.section-head { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:28px 0 14px; }
.section-head h2 { margin:0; font-size:1.05rem; letter-spacing:-.015em; }
.section-head p { margin:2px 0 0; color:var(--text-muted); font-size:.9rem; }

.grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; }
.grid.two { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.card {
  background:var(--surface-elevated); border:1px solid var(--border); border-radius:13px;
  padding:18px; transition:transform .16s ease, background .16s ease, border-color .16s ease;
}
.card:hover { transform:translateY(-2px); background:color-mix(in srgb, var(--surface-elevated) 86%, var(--surface-hover)); }
.card h3 { margin:10px 0 5px; font-size:1rem; line-height:1.25; }
.card p { margin:0; color:var(--text-secondary); font-size:.9rem; }
.card-meta { margin-top:16px; display:flex; justify-content:space-between; gap:10px; align-items:center; color:var(--text-muted); font-size:.78rem; }

.type-pill {
  display:inline-flex; align-items:center; gap:6px; width:max-content; padding:5px 8px;
  border-radius:7px; font-weight:850; font-size:.69rem; letter-spacing:.055em; text-transform:uppercase;
  background:var(--accent-soft); color:var(--primary);
}
.type-pill.material { color:var(--text-secondary); background:var(--surface-hover); }
.type-pill.quiz { color:var(--primary); background:var(--accent-soft); }
.type-pill.dynamic { color:var(--primary); background:color-mix(in srgb, var(--accent-soft) 72%, transparent); }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px;
  border:1px solid var(--border); border-radius:8px; background:var(--surface-elevated);
  color:var(--text-primary); padding:8px 13px; cursor:pointer; font-weight:750;
}
.btn:hover { background:var(--surface-hover); }
.btn.primary { background:var(--primary); color:#fff; border-color:transparent; }
[data-theme="dark"] .btn.primary { color:#161320; }
.btn.primary:hover { background:var(--primary-hover); }
.btn.danger { color:var(--danger); }
.btn.icon { width:40px; padding:0; }
.btn.small { min-height:34px; padding:6px 10px; font-size:.82rem; }

.filters { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.filter {
  border:1px solid var(--border); background:var(--surface-elevated); color:var(--text-secondary);
  border-radius:999px; padding:7px 12px; cursor:pointer; font-weight:700; font-size:.82rem;
}
.filter.active { background:var(--accent-soft); color:var(--primary); border-color:transparent; }

.empty {
  border:1px dashed var(--border); border-radius:13px; padding:34px; color:var(--text-muted);
  text-align:center; background:color-mix(in srgb, var(--surface) 70%, transparent);
}
.mobile-menu { display:none; }

.form-card { max-width:780px; margin:0 auto; }
.field { display:grid; gap:6px; margin-bottom:14px; }
.field label { font-size:.8rem; color:var(--text-secondary); font-weight:800; }
.input, .textarea, .select {
  width:100%; background:var(--surface-elevated); color:var(--text-primary);
  border:1px solid var(--border); border-radius:8px; min-height:42px; padding:9px 11px;
}
.textarea { min-height:96px; resize:vertical; }
.input::placeholder, .textarea::placeholder { color:var(--text-muted); }
.row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:18px; align-items:center; }

.table-wrap { overflow:auto; border:1px solid var(--border); border-radius:13px; background:var(--surface-elevated); }
.table { width:100%; border-collapse:collapse; min-width:720px; }
.table th, .table td { padding:13px 14px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.table th { color:var(--text-muted); font-size:.75rem; text-transform:uppercase; letter-spacing:.07em; }
.table td { font-size:.9rem; }
.table tr:last-child td { border-bottom:0; }

.notice { padding:11px 13px; border:1px solid var(--border); border-radius:9px; background:var(--surface); color:var(--text-secondary); font-size:.88rem; }
.notice.error { border-color:color-mix(in srgb, var(--danger) 45%, var(--border)); color:var(--danger); }
.notice.success { border-color:color-mix(in srgb, var(--success) 45%, var(--border)); color:var(--success); }

.modal-backdrop {
  position:fixed; inset:0; background:rgba(0,0,0,.44); display:grid; place-items:center; padding:20px; z-index:100;
}
.modal { width:min(720px, 100%); max-height:90vh; overflow:auto; border-radius:14px; background:var(--background); border:1px solid var(--border); padding:22px; box-shadow:0 24px 80px rgba(0,0,0,.25); }
.modal-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:18px; }
.modal-head h2 { margin:0; font-size:1.08rem; }

.quiz-question { margin:16px 0; padding:18px; border:1px solid var(--border); background:var(--surface-elevated); border-radius:12px; }
.quiz-question h3 { margin:0 0 12px; font-size:1rem; }
.options { display:grid; gap:8px; }
.option { display:flex; gap:9px; align-items:flex-start; border:1px solid var(--border); border-radius:8px; padding:10px; cursor:pointer; }
.option:hover { background:var(--surface-hover); }

.question-builder { border:1px solid var(--border); border-radius:11px; padding:14px; margin:12px 0; background:var(--surface); }
.question-builder-head { display:flex; gap:8px; justify-content:space-between; align-items:center; margin-bottom:10px; }

.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:18px 0 24px; }
.stat { background:var(--surface-elevated); border:1px solid var(--border); border-radius:12px; padding:18px; }
.stat strong { display:block; font-size:1.8rem; letter-spacing:-.04em; }
.stat span { color:var(--text-muted); font-size:.82rem; }

.footer-note { margin-top:44px; color:var(--text-muted); font-size:.78rem; text-align:center; }

@media (max-width: 960px) {
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .app-shell { grid-template-columns:220px minmax(0,1fr); }
  .content { width:min(100% - 32px, 1100px); }
}
@media (max-width: 720px) {
  .app-shell { display:block; }
  .sidebar {
    position:fixed; left:0; top:0; width:min(300px, 88vw); transform:translateX(-105%);
    transition:transform .2s ease; box-shadow:20px 0 60px rgba(0,0,0,.18);
  }
  body.menu-open .sidebar { transform:translateX(0); }
  .mobile-menu { display:inline-flex; }
  .topbar { height:62px; padding:0 16px; }
  .content { width:calc(100% - 24px); padding-top:22px; }
  .hero { padding:24px 20px; }
  .grid, .grid.two, .stat-grid { grid-template-columns:1fr; }
  .row { grid-template-columns:1fr; }
  .card { padding:16px; }
  .modal { padding:17px; }
}
@media print {
  body { background:#fff !important; color:#000 !important; }
  .sidebar, .topbar, .no-print, .filters, .footer-note { display:none !important; }
  .app-shell { display:block; }
  .content { width:100%; padding:0; }
  .card, .quiz-question { border:1px solid #bbb; break-inside:avoid; background:#fff !important; }
  .print-only { display:block !important; }
}
.print-only { display:none; }


/* v2.1 — gerenciamento de turmas */
.class-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}

.class-inactive {
  opacity:.72;
  background:color-mix(in srgb, var(--surface-elevated) 82%, var(--surface));
}

.status-badge {
  display:inline-flex;
  align-items:center;
  min-height:25px;
  border-radius:999px;
  padding:4px 8px;
  font-size:.7rem;
  font-weight:850;
  border:1px solid var(--border);
}

.status-badge.active {
  color:var(--success);
  background:color-mix(in srgb, var(--success) 9%, var(--surface-elevated));
}

.status-badge.inactive {
  color:var(--text-muted);
  background:var(--surface);
}

.danger-panel {
  border:1px solid color-mix(in srgb, var(--danger) 42%, var(--border));
  background:color-mix(in srgb, var(--danger) 7%, var(--surface-elevated));
  border-radius:10px;
  padding:14px;
  margin-bottom:16px;
}

.danger-panel strong {
  color:var(--danger);
}

.danger-panel p {
  margin:6px 0 0;
  color:var(--text-secondary);
}

.btn.danger-solid {
  background:var(--danger);
  border-color:var(--danger);
  color:#fff;
}

.btn.danger-solid:hover:not(:disabled) {
  filter:brightness(.93);
}

.btn:disabled {
  opacity:.48;
  cursor:not-allowed;
}

@media (max-width:720px) {
  .class-actions {
    width:100%;
    justify-content:flex-start;
  }
  .class-actions .btn {
    flex:1 1 auto;
  }
}


/* ============================================================
   Portal do Aluno • Prof Guto — v2.211
   ============================================================ */

.portal-brand {
  min-width:0;
  text-decoration:none;
}

.brand-logo {
  width:42px;
  height:42px;
  object-fit:contain;
  flex:0 0 auto;
  filter:drop-shadow(0 5px 12px rgba(57,36,145,.16));
}

.portal-brand .brand-text {
  min-width:0;
}

.portal-brand .brand-text strong {
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.portal-brand .brand-text span {
  color:var(--primary);
  font-weight:750;
}

.portal-hero {
  padding-bottom:30px;
}

.portal-hero::before {
  content:"G";
  position:absolute;
  right:30px;
  bottom:-50px;
  font-size:190px;
  font-weight:950;
  line-height:1;
  color:var(--primary);
  opacity:.035;
  letter-spacing:-.09em;
  pointer-events:none;
}

.hero-steps {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:20px;
  position:relative;
  z-index:1;
}

.hero-steps span {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:33px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:color-mix(in srgb, var(--surface-elevated) 78%, transparent);
  color:var(--text-secondary);
  font-size:.78rem;
  font-weight:750;
}

.hero-steps b {
  display:inline-grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--accent-soft);
  color:var(--primary);
  font-size:.7rem;
}

.continue-card {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:15px 17px;
  margin:-8px 0 24px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-elevated);
}

.continue-card > div {
  display:grid;
  gap:2px;
}

.continue-label {
  color:var(--text-muted);
  font-size:.73rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.07em;
}

.class-card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.class-arrow {
  color:var(--primary);
  font-size:1.15rem;
  transition:transform .16s ease;
}

.class-card:hover .class-arrow {
  transform:translateX(3px);
}

.post-card-badges {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}

.fresh-pill {
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:4px 8px;
  border-radius:999px;
  background:color-mix(in srgb, var(--success) 10%, var(--surface-elevated));
  color:var(--success);
  border:1px solid color-mix(in srgb, var(--success) 25%, var(--border));
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.045em;
  text-transform:uppercase;
}

.card-action {
  color:var(--primary);
  font-weight:800;
}

.card-action:hover {
  color:var(--primary-hover);
  text-decoration:underline;
  text-underline-offset:3px;
}

.content-tools {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:16px;
}

.content-tools .filters {
  margin-bottom:0;
}

.search-box {
  position:relative;
  width:min(320px, 100%);
  flex:0 0 auto;
}

.search-box > span {
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-muted);
  pointer-events:none;
  font-size:1rem;
}

.search-box .input {
  padding-left:36px;
}

@media (max-width:900px) {
  .content-tools {
    flex-direction:column;
    align-items:stretch;
  }

  .search-box {
    width:100%;
  }
}

@media (max-width:720px) {
  .brand-logo {
    width:40px;
    height:40px;
  }

  .portal-hero::before {
    font-size:135px;
    right:8px;
    bottom:-25px;
  }

  .hero-steps {
    display:grid;
    grid-template-columns:1fr;
  }

  .continue-card {
    align-items:stretch;
    flex-direction:column;
  }

  .continue-card .btn {
    width:100%;
  }
}
