
  :root {
    --paper: #EDEAE0;
    --ink: #1D3557;
    --ink-light: #2E4A72;
    --margin-red: #A63A36;
    --brass: #A9852E;
    --text: #24262B;
    --text-soft: #565b52;
    --line: rgba(29,53,87,0.10);
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    background: var(--paper);
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px);
    background-size: 100% 34px;
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100vh;
  }
  .margin-rule {
    position: fixed;
    top: 0; bottom: 0; left: 64px;
    width: 2px;
    background: var(--margin-red);
    opacity: 0.35;
    z-index: 0;
  }
  .wrap {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 32px 96px 96px;
  }
  header { margin-bottom: 40px; }
  .tag {
    display: inline-block;
    font-family: "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--margin-red);
    border: 1px solid var(--margin-red);
    padding: 3px 8px;
    border-radius: 2px;
    transform: rotate(-1.5deg);
    margin-bottom: 14px;
  }
  h1 {
    font-family: Georgia, "Iowan Old Style", serif;
    font-weight: 700;
    font-size: 34px;
    letter-spacing: -0.01em;
    margin: 0 0 8px 0;
    color: var(--ink);
  }
  .subtitle {
    color: var(--text-soft);
    font-size: 15px;
    max-width: 60ch;
    line-height: 1.5;
  }
  .card {
    background: #fff;
    border: 1px solid rgba(29,53,87,0.14);
    border-radius: 3px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(29,53,87,0.06);
  }
  .field { margin-bottom: 18px; }
  label {
    display: block;
    font-family: "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 6px;
  }
  input[type=text], input[type=number], textarea {
    width: 100%;
    font-family: -apple-system, "Segoe UI", sans-serif;
    font-size: 14.5px;
    padding: 10px 12px;
    border: 1px solid rgba(29,53,87,0.25);
    border-radius: 3px;
    background: #FBFAF6;
    color: var(--text);
  }
  textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
  input:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(29,53,87,0.12);
  }
  .row { display: flex; gap: 16px; }
  .row .field { flex: 1; }
  button.primary {
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  button.primary:hover { background: var(--ink-light); }
  button.primary:disabled { background: #9aa2ac; cursor: not-allowed; }
  .error {
    color: var(--margin-red);
    font-size: 13.5px;
    margin-top: 10px;
  }
  .section-title {
    font-family: Georgia, serif;
    font-size: 19px;
    color: var(--ink);
    margin: 36px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--margin-red);
    display: inline-block;
  }
  .plano-text {
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 14.5px;
  }
  .aula-card {
    border-left: 3px solid var(--brass);
  }
  .aula-topico {
    font-weight: 700;
    color: var(--ink);
    font-size: 15px;
    margin-bottom: 12px;
  }
  .block-label {
    font-family: "Courier New", monospace;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin: 14px 0 6px 0;
  }
  .block-text {
    background: #FBFAF6;
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    position: relative;
  }
  .copy-btn {
    font-family: "Courier New", monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: transparent;
    border: 1px solid rgba(29,53,87,0.3);
    color: var(--ink);
    padding: 4px 9px;
    border-radius: 3px;
    cursor: pointer;
    float: right;
    margin-left: 8px;
  }
  .copy-btn:hover { background: rgba(29,53,87,0.06); }
  .loading {
    color: var(--text-soft);
    font-size: 14px;
    font-style: italic;
  }
  .empty-hint {
    color: var(--text-soft);
    font-size: 13.5px;
  }
  .step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 12px;
    margin-right: 10px;
  }
  .step-badge.done { background: var(--brass); }
  .card-title {
    font-family: Georgia, serif;
    font-size: 17px;
    color: var(--ink);
    display: flex;
    align-items: center;
    margin-bottom: 16px;
  }
  input[type=file] {
    width: 100%;
    font-size: 13.5px;
    padding: 10px;
    border: 1px dashed rgba(29,53,87,0.35);
    border-radius: 3px;
    background: #FBFAF6;
  }
  .curso-info {
    font-size: 13.5px;
    color: var(--text-soft);
    margin-bottom: 16px;
  }
  .componente-card {
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #FBFAF6;
  }
  .componente-nome {
    font-weight: 700;
    color: var(--ink);
    font-size: 14.5px;
  }
  .componente-ch {
    font-family: "Courier New", monospace;
    font-size: 11px;
    color: var(--brass);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .componente-topicos {
    margin: 8px 0 12px 0;
    padding-left: 18px;
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.6;
  }
  button.secondary {
    background: transparent;
    border: 1px solid var(--ink);
    color: var(--ink);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
  }
  button.secondary:hover { background: rgba(29,53,87,0.06); }
  .fieldset-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .fieldset-inline .field { margin-bottom: 0; min-width: 140px; }
  .warning-note {
    font-size: 12.5px;
    color: var(--margin-red);
    margin-top: 10px;
  }
  .freq-aluno-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .freq-aluno-nome { flex: 1; font-size: 14px; }
  .freq-confianca-baixa {
    font-family: "Courier New", monospace;
    font-size: 10px;
    color: var(--margin-red);
    text-transform: uppercase;
  }
  .freq-toggle {
    display: flex;
    gap: 4px;
  }
  .freq-toggle button {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 3px;
    border: 1px solid rgba(29,53,87,0.3);
    background: #fff;
    cursor: pointer;
  }
  .freq-toggle button.ativo-presente { background: #dff0d8; border-color: #5cb85c; font-weight: 700; }
  .freq-toggle button.ativo-falta { background: #f2dede; border-color: #d9534f; font-weight: 700; }

/* ---------- Autenticação e navegação (sistema completo) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: #fff;
  border: 1px solid rgba(29,53,87,0.14);
  border-radius: 4px;
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(29,53,87,0.08);
}
.auth-card h1 {
  font-family: Georgia, serif;
  color: var(--ink);
  margin: 0 0 4px 0;
}
.auth-card .subtitle { margin-bottom: 20px; }
.auth-card label {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 14px 0 6px 0;
}
.auth-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(29,53,87,0.25);
  border-radius: 3px;
  font-size: 14px;
}
.auth-card button.primary { width: 100%; margin-top: 20px; }
.error-msg { color: var(--margin-red); font-size: 13.5px; margin-bottom: 10px; }
.switch-link { text-align: center; margin-top: 18px; font-size: 13.5px; }
.switch-link a { color: var(--ink); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: #fff;
  border-bottom: 1px solid rgba(29,53,87,0.12);
  position: relative;
  z-index: 2;
}
.topbar .brand { font-family: Georgia, serif; color: var(--ink); font-weight: 700; font-size: 18px; }
.topbar nav a {
  margin-left: 18px;
  font-size: 13.5px;
  color: var(--text-soft);
  text-decoration: none;
}
.topbar nav a:hover { color: var(--ink); }
