/* ===================================================================== *
 * Binário Academy — folha de estilo própria (sem Bootstrap).            *
 * Framework mínimo: reboot + utilitários + componentes usados nos        *
 * templates. Tokens em :root; nada de dependências externas.             *
 * ===================================================================== */
:root {
  --brand: #0b4f8a;
  --brand-dark: #083b68;
  /* Identidade Binário Academy: azul eléctrico do logótipo, para destaques. */
  --brand-accent: #1b8cff;
  --brand-accent-soft: #e8f2ff;
  /* Tokens neutros próprios (substituem as antigas variáveis de framework). */
  --fg: #1b2733;
  --muted: #5b6b7b;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --surface-tertiary: #f6f8fb;
  --border: #dfe4ec;
  --danger: #c0392b;
  --success: #1f7a44;
  --warning: #b7791f;
  --info: #0d6c8a;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* --------------------------------------------------------------- reboot */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 1rem; line-height: 1.5;
  color: var(--fg); background: #fff; -webkit-font-smoothing: antialiased;
}
main { display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.2; }
h1 { font-size: 2.25rem; } h2 { font-size: 1.8rem; } h3 { font-size: 1.5rem; }
h4 { font-size: 1.3rem; } h5 { font-size: 1.1rem; } h6 { font-size: 1rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: underline; }
a:hover { color: var(--brand-dark); }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
ul, ol { margin: 0 0 1rem; padding-left: 1.5rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre, kbd, samp { font-family: var(--font-mono); font-size: .9em; }
table { border-collapse: collapse; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
.page-link:focus-visible { outline-offset: 1px; }

/* --------------------------------------------------------- tipografia */
.h1 { font-size: 2.25rem; } .h2 { font-size: 1.8rem; } .h3 { font-size: 1.5rem; }
.h4 { font-size: 1.3rem; } .h5 { font-size: 1.1rem; } .h6 { font-size: 1rem; }
.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; line-height: 1.2; }
.display-1 { font-size: clamp(3rem, 8vw, 5rem); font-weight: 700; line-height: 1.1; }
.display-4 { font-size: clamp(2.2rem, 6vw, 3.5rem); font-weight: 700; line-height: 1.1; }
.display-6 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 600; line-height: 1.15; }
.lead { font-size: 1.2rem; font-weight: 400; }
.small, small { font-size: .875em; }
.fs-1 { font-size: 2.25rem; } .fs-2 { font-size: 1.8rem; } .fs-3 { font-size: 1.5rem; }
.fs-4 { font-size: 1.3rem; } .fs-5 { font-size: 1.1rem; } .fs-6 { font-size: 1rem; }
.fw-bold { font-weight: 700; } .fw-semibold { font-weight: 600; } .fw-normal { font-weight: 400; }
.font-monospace { font-family: var(--font-mono); }
.text-center { text-align: center; } .text-start { text-align: left; } .text-end { text-align: right; }
.text-nowrap { white-space: nowrap; }
.text-break { word-wrap: break-word; word-break: break-word; }
.text-prewrap { white-space: pre-wrap; }
.text-decoration-none { text-decoration: none; }
.lh-1 { line-height: 1; }
.font-monospace, .text-break { overflow-wrap: anywhere; }

/* ------------------------------------------------------------ cores */
.text-body { color: var(--fg); }
.text-body-secondary, .text-muted { color: var(--muted); }
.text-white { color: #fff; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning-emphasis { color: #8a5a00; }
.text-brand { color: var(--brand); }
.bg-brand { background-color: var(--brand); }
.bg-dark { background-color: #212830; color: #fff; }
.bg-body-tertiary { background-color: var(--surface-tertiary); }
.opacity-75 { opacity: .75; }

/* ------------------------------------------------- layout: container */
.container, .container-fluid {
  width: 100%; margin-right: auto; margin-left: auto;
  padding-right: .75rem; padding-left: .75rem;
}
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }

/* ------------------------------------------------------- row / gutter */
.row {
  --gx: 1.5rem; --gy: 0;
  display: flex; flex-wrap: wrap;
  margin-top: calc(var(--gy) * -1);
  margin-right: calc(var(--gx) / -2); margin-left: calc(var(--gx) / -2);
}
.row > * {
  box-sizing: border-box; flex-shrink: 0; max-width: 100%;
  margin-top: var(--gy);
  padding-right: calc(var(--gx) / 2); padding-left: calc(var(--gx) / 2);
}
.g-0 { --gx: 0; --gy: 0; } .g-1 { --gx: .25rem; --gy: .25rem; }
.g-2 { --gx: .5rem; --gy: .5rem; } .g-3 { --gx: 1rem; --gy: 1rem; }
.g-4 { --gx: 1.5rem; --gy: 1.5rem; } .g-5 { --gx: 3rem; --gy: 3rem; }

/* ------------------------------------------------ display / flexbox */
.d-none { display: none !important; }
.d-block { display: block; } .d-inline-flex { display: inline-flex; }
.d-flex { display: flex; }
.flex-row { flex-direction: row; } .flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; } .flex-grow-1 { flex-grow: 1; }
.align-items-start { align-items: flex-start; } .align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-self-start { align-self: flex-start; }
.align-middle { vertical-align: middle; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: 1rem; }
@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
  .align-items-md-center { align-items: center; }
}
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-block { display: block !important; }
}

/* ---------------------------------------------- dimensões / posição */
.w-100 { width: 100%; } .h-100 { height: 100%; } .min-vh-100 { min-height: 100vh; }
.position-relative { position: relative; } .position-absolute { position: absolute; }
.top-0 { top: 0; } .start-100 { left: 100%; }
.translate-middle { transform: translate(-50%, -50%); }
.overflow-hidden { overflow: hidden; }
.object-fit-cover { object-fit: cover; }
.img-fluid { max-width: 100%; height: auto; }

/* --------------------------------------------- bordas / cantos / sombra */
.border { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-end { border-right: 1px solid var(--border); }
.border-warning { border-color: #e0b650 !important; }
.border-success { border-color: #7fc49b !important; }
.rounded { border-radius: .375rem; }
.rounded-pill { border-radius: 50rem; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(16, 36, 64, .075); }

/* ------------------------------------------------------- proporção 16:9 */
.ratio { position: relative; width: 100%; }
.ratio::before { content: ""; display: block; padding-top: var(--ratio, 56.25%); }
.ratio > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.ratio-16x9 { --ratio: 56.25%; }

/* -------------------------------------------------- acessibilidade */
.visually-hidden, .visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------- ícones SVG */
.icon {
  display: inline-block; width: 1em; height: 1em;
  vertical-align: -.125em; fill: currentColor; flex-shrink: 0;
}

/* ===================================================== logótipo da marca */
.navbar-logo { height: 2.15rem; width: auto; display: block; }
.footer-logo { height: 1.9rem; width: auto; }
.navbar-brand { display: inline-flex; align-items: center; }

/* ===================================================== contactos (público) */
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.contact-list li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.contact-list a { color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.contact-list a:hover { text-decoration: underline; }
.contact-list .icon { color: var(--brand-accent); flex-shrink: 0; }
.contact-list-label { font-size: .78rem; color: var(--muted); }
.contact-list-inline { flex-direction: row; flex-wrap: wrap; gap: .35rem 1.25rem; }

.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }

/* Ícone de um contacto na gestão (admin) */
.contact-ico {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--brand-accent-soft); color: var(--brand);
}

/* ============================================================ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; font-size: 1rem; font-weight: 500; line-height: 1.4;
  border: 1px solid transparent; border-radius: .375rem; cursor: pointer;
  text-decoration: none; background: transparent; color: var(--fg);
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .6; pointer-events: none; }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1.15rem; }
.btn-brand, .btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.btn-brand:hover, .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #185f35; border-color: #185f35; color: #fff; }
.btn-warning { background: #e0a93b; border-color: #e0a93b; color: #1b2733; }
.btn-warning:hover { background: #cf981f; border-color: #cf981f; }
.btn-light { background: #f3f5f8; border-color: #e2e8f0; color: var(--fg); }
.btn-light:hover { background: #e6ebf1; }
.btn-outline-primary { border-color: var(--brand); color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); color: #fff; }
.btn-outline-secondary { border-color: #c3ccd8; color: #45535f; }
.btn-outline-secondary:hover { background: #f1f4f8; color: var(--fg); }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-success { border-color: var(--success); color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-link { border: 0; color: var(--brand); text-decoration: underline; padding-left: .25rem; padding-right: .25rem; }
.btn-link:hover { color: var(--brand-dark); }

.btn-close {
  width: 1rem; height: 1rem; padding: .35rem; border: 0; border-radius: .25rem;
  background: transparent; cursor: pointer; opacity: .6; line-height: 1;
  font-size: 1.1rem; color: inherit;
}
.btn-close::before { content: "\00d7"; }
.btn-close:hover { opacity: 1; }

/* ============================================================= cartões */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: .5rem;
  overflow-wrap: break-word;
}
.card-body { flex: 1 1 auto; padding: 1rem 1.1rem; }
.card-header {
  padding: .75rem 1.1rem; border-bottom: 1px solid var(--border);
  font-weight: 600; background: transparent;
}
.card-img-top { width: 100%; border-top-left-radius: .5rem; border-top-right-radius: .5rem; object-fit: cover; }
.stretched-link::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
}

/* ============================================================= navbar */
.navbar {
  display: flex; flex-wrap: wrap; align-items: center;
  padding: .6rem 0; position: relative;
}
.navbar .container { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.navbar-brand { font-size: 1.2rem; font-weight: 600; text-decoration: none; color: #fff; display: inline-flex; align-items: center; gap: .4rem; }
.navbar-dark, .navbar-dark .navbar-brand, .navbar-dark .nav-link { color: rgba(255,255,255,.9); }
.navbar-nav { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; gap: .1rem; }
.navbar-nav .nav-link { color: rgba(255,255,255,.85); text-decoration: none; padding: .4rem .7rem; border-radius: .375rem; display: inline-flex; align-items: center; gap: .4rem; }
.navbar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.navbar-toggler {
  margin-left: auto; padding: .35rem .6rem; background: transparent;
  border: 1px solid rgba(255,255,255,.4); border-radius: .375rem; cursor: pointer;
}
.navbar-toggler-icon {
  display: inline-block; width: 1.4rem; height: 1.4rem; vertical-align: middle;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.85)' stroke-width='2' stroke-linecap='round' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.navbar-collapse { flex-basis: 100%; }
.collapse:not(.show) { display: none; }
@media (min-width: 768px) {
  .navbar-expand-md .navbar-toggler { display: none; }
  /* flex-grow: ocupa o espaço livre, para o ms-auto empurrar os links para a direita. */
  .navbar-expand-md .navbar-collapse { display: flex !important; flex-basis: auto; flex-grow: 1; }
  .navbar-expand-md .navbar-brand { margin-right: 2rem; }
  .navbar-expand-md .navbar-nav { flex-direction: row; align-items: center; }
}

/* ======================================================= nav genérico */
.nav { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.nav-link { display: block; padding: .5rem .75rem; color: var(--brand); text-decoration: none; background: transparent; border: 0; }
.nav-item { list-style: none; }

/* ======================================================= breadcrumb */
.breadcrumb { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .9rem; }
.breadcrumb-item { display: flex; align-items: center; color: var(--muted); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding: 0 .5rem; color: var(--muted); }
.breadcrumb-item a { color: var(--brand); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--muted); }

/* ============================================================ alertas */
.alert {
  position: relative; padding: .75rem 1rem; margin-bottom: 1rem;
  border: 1px solid transparent; border-radius: .375rem;
}
.alert-success { color: #0f5132; background: #d1e7dd; border-color: #badbcc; }
.alert-info { color: #055160; background: #cff4fc; border-color: #b6effb; }
.alert-warning { color: #664d03; background: #fff3cd; border-color: #ffecb5; }
.alert-danger { color: #842029; background: #f8d7da; border-color: #f5c2c7; }
.alert-secondary { color: #41464b; background: #e2e3e5; border-color: #d3d6d8; }
.alert-dismissible { padding-right: 2.5rem; }
.alert-dismissible .btn-close { position: absolute; top: .4rem; right: .4rem; }
.fade { transition: opacity .15s linear; }
.fade:not(.show) { opacity: 0; }

/* ============================================================= badges */
.badge {
  display: inline-block; padding: .35em .6em; font-size: .75em; font-weight: 600;
  line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline;
  border-radius: .375rem; color: #fff; background: var(--muted);
}
.text-bg-success { background: var(--success); color: #fff; }
.text-bg-danger  { background: var(--danger); color: #fff; }
.text-bg-warning { background: #ffc107; color: #1b2733; }
.text-bg-info    { background: #0dcaf0; color: #04323d; }
.text-bg-light   { background: #e9edf2; color: #1b2733; }
.text-bg-secondary { background: #6c757d; color: #fff; }

/* ============================================================= tabelas */
.table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; color: var(--fg); }
.table th, .table td { padding: .6rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { border-bottom: 2px solid var(--border); font-weight: 600; }
.table-sm th, .table-sm td { padding: .35rem .4rem; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* =========================================================== list-group */
.list-group { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-radius: .5rem; }
.list-group-item {
  position: relative; display: block; padding: .7rem 1rem; background: var(--surface);
  border: 1px solid var(--border); margin-top: -1px;
}
.list-group-item.d-flex { display: flex; }
.list-group-item:first-child { border-top-left-radius: .5rem; border-top-right-radius: .5rem; }
.list-group-item:last-child { border-bottom-left-radius: .5rem; border-bottom-right-radius: .5rem; }
.list-group-flush { border-radius: 0; }
.list-group-flush > .list-group-item { border-right: 0; border-left: 0; }
.list-group-flush > .list-group-item:first-child { border-top: 0; }
.list-group-item-action { width: 100%; text-align: inherit; color: var(--fg); text-decoration: none; cursor: pointer; }
.list-group-item-action:hover { background: var(--surface-2); }
.list-group-numbered { list-style: decimal inside; }
.list-group-numbered > .list-group-item { list-style-position: inside; }
.list-unstyled { list-style: none; padding-left: 0; margin-left: 0; }

/* =========================================================== formulários */
.form-label { display: inline-block; margin-bottom: .35rem; font-weight: 500; }
.form-control, .form-select {
  display: block; width: 100%; padding: .5rem .75rem; font-size: 1rem; line-height: 1.5;
  color: var(--fg); background: #fff; border: 1px solid #c3ccd8; border-radius: .375rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-accent); box-shadow: 0 0 0 .2rem rgba(27, 140, 255, .2); outline: 0;
}
.form-control::placeholder { color: #9aa7b4; }
.form-control-sm, .form-select-sm { padding: .3rem .55rem; font-size: .85rem; }
.form-select {
  appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235b6b7b' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: .8rem;
}
.form-text { display: block; margin-top: .25rem; font-size: .85rem; color: var(--muted); }
.form-check { display: block; min-height: 1.4rem; padding-left: 1.6rem; margin-bottom: .25rem; }
.form-check-input {
  margin-left: -1.6rem; margin-top: .15rem; width: 1rem; height: 1rem; vertical-align: top;
  border: 1px solid #b4bfcc; appearance: none; background: #fff; cursor: pointer;
  float: left;
}
.form-check-input[type="checkbox"] { border-radius: .25rem; }
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:checked { background: var(--brand); border-color: var(--brand); }
.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.5' d='M3 8l3.5 3.5L13 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: .8rem;
}
.form-check-input:checked[type="radio"] {
  background-image: radial-gradient(circle, #fff 34%, transparent 38%);
}
.form-check-input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 .2rem rgba(27,140,255,.2); outline: 0; }
.form-check-label { cursor: pointer; }
.input-group { display: flex; flex-wrap: wrap; align-items: stretch; }
.input-group > .form-control, .input-group > .form-select { flex: 1 1 auto; width: 1%; }
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.invalid-feedback { display: block; width: 100%; margin-top: .25rem; font-size: .85rem; color: var(--danger); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }

/* =========================================================== paginação */
.pagination { display: flex; list-style: none; padding: 0; margin: 1rem 0 0; gap: .25rem; }
.page-item { list-style: none; }
.page-link {
  display: block; padding: .4rem .7rem; color: var(--brand); text-decoration: none;
  border: 1px solid var(--border); border-radius: .375rem; background: #fff; cursor: pointer;
}
.page-link:hover { background: var(--surface-2); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-item.disabled .page-link { color: #9aa7b4; pointer-events: none; background: #fff; }
.pagination-sm .page-link { padding: .25rem .5rem; font-size: .85rem; }

/* ====================================================== progresso */
.progress { display: flex; height: 1rem; overflow: hidden; background: var(--surface-2); border-radius: .375rem; }
.progress-bar { display: flex; flex-direction: column; justify-content: center; background: var(--brand); color: #fff; width: 0; transition: width .4s ease; }

/* =========================================================== offcanvas *
 * .offcanvas-lg: painel lateral fixo a partir de lg; gaveta abaixo disso. */
.offcanvas, .offcanvas-lg {
  display: flex; flex-direction: column; background: var(--surface);
}
.offcanvas-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.offcanvas-title { margin: 0; }
@media (max-width: 991.98px) {
  .offcanvas-lg {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1070; width: 18rem; max-width: 80%;
    border-right: 1px solid var(--border); box-shadow: 0 0 2rem rgba(16,36,64,.18);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
  }
  .offcanvas-lg.show { transform: none; visibility: visible; }
}
@media (min-width: 992px) {
  .offcanvas-lg { position: static; transform: none; visibility: visible; width: auto; }
  .offcanvas-lg .offcanvas-header { display: none; }
}
.offcanvas-backdrop {
  position: fixed; inset: 0; z-index: 1060; background: rgba(16,36,64,.5);
  opacity: 0; transition: opacity .2s ease;
}
.offcanvas-backdrop.show { opacity: 1; }
body.offcanvas-open { overflow: hidden; }

.skip-link {
  position: absolute; top: .5rem; left: .5rem; z-index: 1080;
  padding: .5rem 1rem; background: #fff; border-radius: .25rem;
}


/* grelha */
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25.000000%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50.000000%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75.000000%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100.000000%; }
@media (min-width: 576px) {
.col-sm { flex: 1 0 0%; }
.col-sm-auto { flex: 0 0 auto; width: auto; }
.col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
.col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
.col-sm-3 { flex: 0 0 auto; width: 25.000000%; }
.col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
.col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
.col-sm-6 { flex: 0 0 auto; width: 50.000000%; }
.col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
.col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
.col-sm-9 { flex: 0 0 auto; width: 75.000000%; }
.col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
.col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
.col-sm-12 { flex: 0 0 auto; width: 100.000000%; }
}
@media (min-width: 768px) {
.col-md { flex: 1 0 0%; }
.col-md-auto { flex: 0 0 auto; width: auto; }
.col-md-1 { flex: 0 0 auto; width: 8.333333%; }
.col-md-2 { flex: 0 0 auto; width: 16.666667%; }
.col-md-3 { flex: 0 0 auto; width: 25.000000%; }
.col-md-4 { flex: 0 0 auto; width: 33.333333%; }
.col-md-5 { flex: 0 0 auto; width: 41.666667%; }
.col-md-6 { flex: 0 0 auto; width: 50.000000%; }
.col-md-7 { flex: 0 0 auto; width: 58.333333%; }
.col-md-8 { flex: 0 0 auto; width: 66.666667%; }
.col-md-9 { flex: 0 0 auto; width: 75.000000%; }
.col-md-10 { flex: 0 0 auto; width: 83.333333%; }
.col-md-11 { flex: 0 0 auto; width: 91.666667%; }
.col-md-12 { flex: 0 0 auto; width: 100.000000%; }
}
@media (min-width: 992px) {
.col-lg { flex: 1 0 0%; }
.col-lg-auto { flex: 0 0 auto; width: auto; }
.col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
.col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
.col-lg-3 { flex: 0 0 auto; width: 25.000000%; }
.col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
.col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
.col-lg-6 { flex: 0 0 auto; width: 50.000000%; }
.col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
.col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
.col-lg-9 { flex: 0 0 auto; width: 75.000000%; }
.col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
.col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
.col-lg-12 { flex: 0 0 auto; width: 100.000000%; }
}
@media (min-width: 1200px) {
.col-xl { flex: 1 0 0%; }
.col-xl-auto { flex: 0 0 auto; width: auto; }
.col-xl-1 { flex: 0 0 auto; width: 8.333333%; }
.col-xl-2 { flex: 0 0 auto; width: 16.666667%; }
.col-xl-3 { flex: 0 0 auto; width: 25.000000%; }
.col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
.col-xl-5 { flex: 0 0 auto; width: 41.666667%; }
.col-xl-6 { flex: 0 0 auto; width: 50.000000%; }
.col-xl-7 { flex: 0 0 auto; width: 58.333333%; }
.col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
.col-xl-9 { flex: 0 0 auto; width: 75.000000%; }
.col-xl-10 { flex: 0 0 auto; width: 83.333333%; }
.col-xl-11 { flex: 0 0 auto; width: 91.666667%; }
.col-xl-12 { flex: 0 0 auto; width: 100.000000%; }
}

/* espaçamentos */
.m-0 { margin: 0; }
.m-1 { margin: .25rem; }
.m-2 { margin: .5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }
.m-auto { margin: auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-auto { margin-bottom: auto; }
.ms-0 { margin-left: 0; }
.ms-1 { margin-left: .25rem; }
.ms-2 { margin-left: .5rem; }
.ms-3 { margin-left: 1rem; }
.ms-4 { margin-left: 1.5rem; }
.ms-5 { margin-left: 3rem; }
.ms-auto { margin-left: auto; }
.me-0 { margin-right: 0; }
.me-1 { margin-right: .25rem; }
.me-2 { margin-right: .5rem; }
.me-3 { margin-right: 1rem; }
.me-4 { margin-right: 1.5rem; }
.me-5 { margin-right: 3rem; }
.me-auto { margin-right: auto; }
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: .25rem; margin-right: .25rem; }
.mx-2 { margin-left: .5rem; margin-right: .5rem; }
.mx-3 { margin-left: 1rem; margin-right: 1rem; }
.mx-4 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-5 { margin-left: 3rem; margin-right: 3rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: .25rem; margin-bottom: .25rem; }
.my-2 { margin-top: .5rem; margin-bottom: .5rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.p-0 { padding: 0; }
.p-1 { padding: .25rem; }
.p-2 { padding: .5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: .25rem; }
.pt-2 { padding-top: .5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }
.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: .25rem; }
.pb-2 { padding-bottom: .5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3rem; }
.ps-0 { padding-left: 0; }
.ps-1 { padding-left: .25rem; }
.ps-2 { padding-left: .5rem; }
.ps-3 { padding-left: 1rem; }
.ps-4 { padding-left: 1.5rem; }
.ps-5 { padding-left: 3rem; }
.pe-0 { padding-right: 0; }
.pe-1 { padding-right: .25rem; }
.pe-2 { padding-right: .5rem; }
.pe-3 { padding-right: 1rem; }
.pe-4 { padding-right: 1.5rem; }
.pe-5 { padding-right: 3rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: .25rem; padding-right: .25rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
@media (min-width: 768px) {
.m-md-0 { margin: 0; }
.m-md-1 { margin: .25rem; }
.m-md-2 { margin: .5rem; }
.m-md-3 { margin: 1rem; }
.m-md-4 { margin: 1.5rem; }
.m-md-5 { margin: 3rem; }
.m-md-auto { margin: auto; }
.mt-md-0 { margin-top: 0; }
.mt-md-1 { margin-top: .25rem; }
.mt-md-2 { margin-top: .5rem; }
.mt-md-3 { margin-top: 1rem; }
.mt-md-4 { margin-top: 1.5rem; }
.mt-md-5 { margin-top: 3rem; }
.mt-md-auto { margin-top: auto; }
.mb-md-0 { margin-bottom: 0; }
.mb-md-1 { margin-bottom: .25rem; }
.mb-md-2 { margin-bottom: .5rem; }
.mb-md-3 { margin-bottom: 1rem; }
.mb-md-4 { margin-bottom: 1.5rem; }
.mb-md-5 { margin-bottom: 3rem; }
.mb-md-auto { margin-bottom: auto; }
.ms-md-0 { margin-left: 0; }
.ms-md-1 { margin-left: .25rem; }
.ms-md-2 { margin-left: .5rem; }
.ms-md-3 { margin-left: 1rem; }
.ms-md-4 { margin-left: 1.5rem; }
.ms-md-5 { margin-left: 3rem; }
.ms-md-auto { margin-left: auto; }
.me-md-0 { margin-right: 0; }
.me-md-1 { margin-right: .25rem; }
.me-md-2 { margin-right: .5rem; }
.me-md-3 { margin-right: 1rem; }
.me-md-4 { margin-right: 1.5rem; }
.me-md-5 { margin-right: 3rem; }
.me-md-auto { margin-right: auto; }
.mx-md-0 { margin-left: 0; margin-right: 0; }
.mx-md-1 { margin-left: .25rem; margin-right: .25rem; }
.mx-md-2 { margin-left: .5rem; margin-right: .5rem; }
.mx-md-3 { margin-left: 1rem; margin-right: 1rem; }
.mx-md-4 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-md-5 { margin-left: 3rem; margin-right: 3rem; }
.mx-md-auto { margin-left: auto; margin-right: auto; }
.my-md-0 { margin-top: 0; margin-bottom: 0; }
.my-md-1 { margin-top: .25rem; margin-bottom: .25rem; }
.my-md-2 { margin-top: .5rem; margin-bottom: .5rem; }
.my-md-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-md-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-md-5 { margin-top: 3rem; margin-bottom: 3rem; }
.my-md-auto { margin-top: auto; margin-bottom: auto; }
.p-md-0 { padding: 0; }
.p-md-1 { padding: .25rem; }
.p-md-2 { padding: .5rem; }
.p-md-3 { padding: 1rem; }
.p-md-4 { padding: 1.5rem; }
.p-md-5 { padding: 3rem; }
.pt-md-0 { padding-top: 0; }
.pt-md-1 { padding-top: .25rem; }
.pt-md-2 { padding-top: .5rem; }
.pt-md-3 { padding-top: 1rem; }
.pt-md-4 { padding-top: 1.5rem; }
.pt-md-5 { padding-top: 3rem; }
.pb-md-0 { padding-bottom: 0; }
.pb-md-1 { padding-bottom: .25rem; }
.pb-md-2 { padding-bottom: .5rem; }
.pb-md-3 { padding-bottom: 1rem; }
.pb-md-4 { padding-bottom: 1.5rem; }
.pb-md-5 { padding-bottom: 3rem; }
.ps-md-0 { padding-left: 0; }
.ps-md-1 { padding-left: .25rem; }
.ps-md-2 { padding-left: .5rem; }
.ps-md-3 { padding-left: 1rem; }
.ps-md-4 { padding-left: 1.5rem; }
.ps-md-5 { padding-left: 3rem; }
.pe-md-0 { padding-right: 0; }
.pe-md-1 { padding-right: .25rem; }
.pe-md-2 { padding-right: .5rem; }
.pe-md-3 { padding-right: 1rem; }
.pe-md-4 { padding-right: 1.5rem; }
.pe-md-5 { padding-right: 3rem; }
.px-md-0 { padding-left: 0; padding-right: 0; }
.px-md-1 { padding-left: .25rem; padding-right: .25rem; }
.px-md-2 { padding-left: .5rem; padding-right: .5rem; }
.px-md-3 { padding-left: 1rem; padding-right: 1rem; }
.px-md-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-md-5 { padding-left: 3rem; padding-right: 3rem; }
.py-md-0 { padding-top: 0; padding-bottom: 0; }
.py-md-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-md-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-md-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-md-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-md-5 { padding-top: 3rem; padding-bottom: 3rem; }
}
@media (min-width: 992px) {
.m-lg-0 { margin: 0; }
.m-lg-1 { margin: .25rem; }
.m-lg-2 { margin: .5rem; }
.m-lg-3 { margin: 1rem; }
.m-lg-4 { margin: 1.5rem; }
.m-lg-5 { margin: 3rem; }
.m-lg-auto { margin: auto; }
.mt-lg-0 { margin-top: 0; }
.mt-lg-1 { margin-top: .25rem; }
.mt-lg-2 { margin-top: .5rem; }
.mt-lg-3 { margin-top: 1rem; }
.mt-lg-4 { margin-top: 1.5rem; }
.mt-lg-5 { margin-top: 3rem; }
.mt-lg-auto { margin-top: auto; }
.mb-lg-0 { margin-bottom: 0; }
.mb-lg-1 { margin-bottom: .25rem; }
.mb-lg-2 { margin-bottom: .5rem; }
.mb-lg-3 { margin-bottom: 1rem; }
.mb-lg-4 { margin-bottom: 1.5rem; }
.mb-lg-5 { margin-bottom: 3rem; }
.mb-lg-auto { margin-bottom: auto; }
.ms-lg-0 { margin-left: 0; }
.ms-lg-1 { margin-left: .25rem; }
.ms-lg-2 { margin-left: .5rem; }
.ms-lg-3 { margin-left: 1rem; }
.ms-lg-4 { margin-left: 1.5rem; }
.ms-lg-5 { margin-left: 3rem; }
.ms-lg-auto { margin-left: auto; }
.me-lg-0 { margin-right: 0; }
.me-lg-1 { margin-right: .25rem; }
.me-lg-2 { margin-right: .5rem; }
.me-lg-3 { margin-right: 1rem; }
.me-lg-4 { margin-right: 1.5rem; }
.me-lg-5 { margin-right: 3rem; }
.me-lg-auto { margin-right: auto; }
.mx-lg-0 { margin-left: 0; margin-right: 0; }
.mx-lg-1 { margin-left: .25rem; margin-right: .25rem; }
.mx-lg-2 { margin-left: .5rem; margin-right: .5rem; }
.mx-lg-3 { margin-left: 1rem; margin-right: 1rem; }
.mx-lg-4 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-lg-5 { margin-left: 3rem; margin-right: 3rem; }
.mx-lg-auto { margin-left: auto; margin-right: auto; }
.my-lg-0 { margin-top: 0; margin-bottom: 0; }
.my-lg-1 { margin-top: .25rem; margin-bottom: .25rem; }
.my-lg-2 { margin-top: .5rem; margin-bottom: .5rem; }
.my-lg-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-lg-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-lg-5 { margin-top: 3rem; margin-bottom: 3rem; }
.my-lg-auto { margin-top: auto; margin-bottom: auto; }
.p-lg-0 { padding: 0; }
.p-lg-1 { padding: .25rem; }
.p-lg-2 { padding: .5rem; }
.p-lg-3 { padding: 1rem; }
.p-lg-4 { padding: 1.5rem; }
.p-lg-5 { padding: 3rem; }
.pt-lg-0 { padding-top: 0; }
.pt-lg-1 { padding-top: .25rem; }
.pt-lg-2 { padding-top: .5rem; }
.pt-lg-3 { padding-top: 1rem; }
.pt-lg-4 { padding-top: 1.5rem; }
.pt-lg-5 { padding-top: 3rem; }
.pb-lg-0 { padding-bottom: 0; }
.pb-lg-1 { padding-bottom: .25rem; }
.pb-lg-2 { padding-bottom: .5rem; }
.pb-lg-3 { padding-bottom: 1rem; }
.pb-lg-4 { padding-bottom: 1.5rem; }
.pb-lg-5 { padding-bottom: 3rem; }
.ps-lg-0 { padding-left: 0; }
.ps-lg-1 { padding-left: .25rem; }
.ps-lg-2 { padding-left: .5rem; }
.ps-lg-3 { padding-left: 1rem; }
.ps-lg-4 { padding-left: 1.5rem; }
.ps-lg-5 { padding-left: 3rem; }
.pe-lg-0 { padding-right: 0; }
.pe-lg-1 { padding-right: .25rem; }
.pe-lg-2 { padding-right: .5rem; }
.pe-lg-3 { padding-right: 1rem; }
.pe-lg-4 { padding-right: 1.5rem; }
.pe-lg-5 { padding-right: 3rem; }
.px-lg-0 { padding-left: 0; padding-right: 0; }
.px-lg-1 { padding-left: .25rem; padding-right: .25rem; }
.px-lg-2 { padding-left: .5rem; padding-right: .5rem; }
.px-lg-3 { padding-left: 1rem; padding-right: 1rem; }
.px-lg-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-lg-5 { padding-left: 3rem; padding-right: 3rem; }
.py-lg-0 { padding-top: 0; padding-bottom: 0; }
.py-lg-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-lg-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-lg-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-lg-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-lg-5 { padding-top: 3rem; padding-bottom: 3rem; }
}


/* ================= CSS próprio preservado (staff/landing/certificado) ================= */
.stat-card .h3 { font-variant-numeric: tabular-nums; }
.table td, .table th { vertical-align: middle; }
.role-list { list-style: none; padding-left: 0; }
.role-list li { margin-bottom: .25rem; }
.role-list input { margin-right: .5rem; }

.lesson { max-width: 52rem; }
.lesson-prose img { max-width: 100%; height: auto; border-radius: .375rem; }
.lesson-prose table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.lesson-prose th, .lesson-prose td { border: 1px solid var(--border); padding: .4rem .6rem; }
.lesson-prose blockquote { border-left: .25rem solid var(--border); padding-left: 1rem; color: var(--muted); }
.lesson-prose pre, .code-block pre { padding: .75rem 1rem; border-radius: .375rem; overflow-x: auto; background: #f6f8fa; }
.codehilite { background: transparent; }

/* ===================================================================== *
 * Área de staff / instrutor (Binário Academy) — design system escopado  *
 * a .staff-shell, para não afectar a área do aluno, pública ou de auth.  *
 * ===================================================================== */
.staff-shell {
  --surface: #fff;
  --surface-muted: #f6f8fb;
  --line: #e6eaf0;
  --elev-1: 0 1px 2px rgba(16, 36, 64, .06), 0 1px 3px rgba(16, 36, 64, .05);
  --elev-2: 0 4px 12px rgba(16, 36, 64, .08), 0 2px 4px rgba(16, 36, 64, .05);
  background: var(--surface-muted); min-height: 100vh;
}

/* ---- Layout com sidebar ---- */
.staff-layout { display: block; }
.staff-content { min-width: 0; }
.staff-main { padding: 1.5rem 1rem; min-width: 0; }

/* Barra superior só no telemóvel (a sidebar é uma gaveta) */
.app-topbar {
  display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem;
  background: var(--brand); position: sticky; top: 0; z-index: 1030;
}
.app-topbar-logo { height: 1.85rem; width: auto; }
.app-topbar-menu, .app-topbar-bell {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  color: #fff; background: transparent; border: 0; cursor: pointer; text-decoration: none; padding: .3rem;
}
.app-topbar-menu { border: 1px solid rgba(255, 255, 255, .4); border-radius: .375rem; }
.app-topbar .icon { width: 1.3rem; height: 1.3rem; }
.app-topbar-bell { margin-left: auto; }
.app-topbar-badge, .staff-nav-badge {
  background: #e5484d; color: #fff; font-weight: 700; border-radius: 50rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.app-topbar-badge { position: absolute; top: -.15rem; right: -.2rem; font-size: .62rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; }
.staff-nav-badge { margin-left: auto; font-size: .68rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem; }

.staff-sidebar {
  background: var(--surface);
  display: flex; flex-direction: column;
}
.staff-sidebar-brand {
  display: flex; align-items: center;
  padding: 1.1rem 1.25rem; margin-bottom: .25rem;
  border-bottom: 1px solid var(--line);
}
.staff-sidebar-brand img { height: 2.1rem; width: auto; }

.staff-sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: .5rem .6rem 1rem; }
.staff-nav { list-style: none; margin: 0; padding: 0; }
.staff-nav-heading {
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 1.1rem .65rem .35rem;
}
.staff-nav-heading:first-child { padding-top: .35rem; }

.staff-nav-link {
  position: relative; display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem; margin: .1rem 0; border-radius: .5rem;
  color: #41505f; font-weight: 500; text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}
.staff-nav-icon { display: inline-flex; color: #8a98a8; transition: color .12s ease; }
.staff-nav-icon .icon { width: 1.15em; height: 1.15em; }
.staff-nav-link:hover { background: var(--surface-muted); color: var(--fg); }
.staff-nav-link:hover .staff-nav-icon { color: var(--brand); }
.staff-nav-link.active {
  background: var(--brand-accent-soft); color: var(--brand-dark); font-weight: 600;
}
.staff-nav-link.active .staff-nav-icon { color: var(--brand); }
.staff-nav-link.active::before {
  content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 1.4rem; border-radius: 0 3px 3px 0; background: var(--brand);
}

/* ---- Rodapé da sidebar: identidade + acesso ao site ---- */
.staff-sidebar-foot { border-top: 1px solid var(--line); padding: .6rem; }
.staff-user {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem;
  border-radius: .5rem; text-decoration: none; color: inherit;
}
.staff-user:hover { background: var(--surface-muted); }
.staff-user-avatar { display: inline-flex; }
.staff-user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.staff-user-name { font-weight: 600; font-size: .9rem; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-user-role { font-size: .75rem; color: var(--muted); }
.staff-sidebar-site {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .55rem; margin-top: .15rem;
  font-size: .85rem; color: var(--muted); text-decoration: none; border-radius: .5rem;
}
.staff-sidebar-site:hover { background: var(--surface-muted); color: var(--brand); }
.staff-sidebar-site .icon { color: var(--brand-accent); }
.staff-sidebar-action {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
  padding: .5rem .55rem; margin-top: .15rem; border-radius: .5rem; cursor: pointer;
  font-size: .85rem; color: var(--muted); background: transparent; border: 0;
}
.staff-sidebar-action:hover { background: var(--surface-muted); color: var(--danger); }
.staff-sidebar-action .icon { color: var(--danger); }

/* ---- Desktop: sidebar fixa, fixada no ecrã, com scroll interno ---- */
@media (min-width: 992px) {
  .staff-layout { display: flex; align-items: flex-start; }
  .staff-sidebar {
    position: sticky; top: 0; height: 100vh;
    flex: 0 0 15.5rem; width: 15.5rem;
    border-right: 1px solid var(--line);
  }
  .staff-content { flex: 1 1 0; max-width: calc(100% - 15.5rem); }
  .staff-main { padding: 1.75rem 2rem; }
}

/* ---- Barra de cabeçalho da página ---- */
.staff-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line);
}
.staff-header .staff-header-title { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.staff-header .breadcrumb { margin: 0; }
.staff-header .staff-header-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---- Cartões ---- */
.staff-shell .card {
  border: 1px solid var(--line); border-radius: .6rem; box-shadow: var(--elev-1);
  background: var(--surface);
}
.staff-shell .card .card-header {
  background: transparent; border-bottom: 1px solid var(--line); font-weight: 600;
}
.staff-card-interactive { transition: box-shadow .14s ease, transform .14s ease; }
.staff-card-interactive:hover { box-shadow: var(--elev-2); transform: translateY(-2px); }

/* ---- Cartões de estatística ---- */
.staff-shell .stat-card { border-radius: .6rem; }
.staff-shell .stat-card .icon { color: var(--brand-accent); }

/* ---- Barra de acções fixa (editor) ---- */
.staff-actionbar {
  position: sticky; top: 0; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .75rem 0; margin-bottom: 1rem;
  background: var(--surface-muted); border-bottom: 1px solid var(--line);
}

/* ---- Indicador de etapas (criação de curso) ---- */
.staff-steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.staff-steps li {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 2rem;
  background: var(--surface); color: var(--muted); font-size: .875rem; font-weight: 500;
}
.staff-steps li .staff-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--surface-muted); color: var(--muted); font-size: .75rem; font-weight: 700;
}
.staff-steps li.is-current { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-accent-soft); }
.staff-steps li.is-current .staff-step-num { background: var(--brand); color: #fff; }
.staff-steps a.is-done { color: var(--fg); text-decoration: none; }
.staff-steps a.is-done .staff-step-num { background: var(--brand-accent); color: #fff; }
.staff-fieldset { border: 0; padding: 0; margin: 0; }
.staff-fieldset > legend {
  float: none; width: auto; font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--line);
}

/* ---- Avatar e identidade da conta ---- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  overflow: hidden; border-radius: 50%; font-weight: 700; letter-spacing: .02em;
  background: var(--brand-accent-soft); color: var(--brand);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 2.1rem; height: 2.1rem; font-size: .8rem; }
.avatar-lg { width: 5.5rem; height: 5.5rem; font-size: 1.8rem; }
.account-identity { display: flex; align-items: center; gap: 1.25rem; }
.account-identity-text { min-width: 0; }
.account-facts dd { margin: 0 0 .6rem; font-weight: 600; }
.card .btn.w-100 { white-space: normal; }

/* ---- Notificações ---- */
.notif-list {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: .85rem;
}
.notif-list > li + li { border-top: 1px solid var(--border); }
.notif-item {
  display: flex; align-items: flex-start; gap: .75rem; width: 100%;
  padding: .9rem 1rem; border: 0; background: transparent; text-align: left;
  font: inherit; color: var(--muted); cursor: pointer;
}
.notif-item:hover { background: var(--surface-tertiary); }
.notif-item.is-unread { color: var(--fg); }
.notif-dot { flex: none; width: .6rem; height: .6rem; margin-top: .4rem; border-radius: 50%; background: transparent; }
.is-unread .notif-dot { background: var(--brand-accent); }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.notif-title { font-weight: 500; }
.is-unread .notif-title { font-weight: 700; }
.notif-body { font-size: .875rem; color: var(--muted); }
.notif-time { flex: none; font-size: .8rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 575.98px) {
  .notif-item { flex-wrap: wrap; }
  .notif-time { flex-basis: 100%; padding-left: 1.35rem; }
}

/* ---- Estados ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 2.5rem 1.25rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: .85rem; background: var(--surface);
}
.empty-state-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--brand-accent-soft); color: var(--brand);
}
.empty-state-icon .icon { width: 1.6rem; height: 1.6rem; }
.empty-state-text { margin: 0; max-width: 28rem; }
.staff-empty { border: 1px dashed var(--line); border-radius: .6rem; background: var(--surface); }
.staff-pill { background: var(--brand-accent-soft); color: var(--brand-dark); border-radius: 2rem;
  padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }

/* ===================================================================== *
 * Barra de progresso (largura aplicada por JS — CSP sem estilos inline)  *
 * ===================================================================== */
.progress-thin { height: .5rem; }

/* ===================================================================== *
 * Página inicial (landing) — animações, transições e skeleton           *
 * ===================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Revelar ao rolar */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.row > .reveal:nth-child(2) { transition-delay: .07s; }
.row > .reveal:nth-child(3) { transition-delay: .14s; }
.row > .reveal:nth-child(4) { transition-delay: .21s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===================================================================== *
 * Hero da landing — escuro, com um «terminal» num arco (tema labs/flags) *
 * ===================================================================== */
.hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: 0 0 1.75rem 1.75rem;
  background:
    radial-gradient(900px 520px at 80% 4%, rgba(27, 140, 255, .28), transparent 60%),
    radial-gradient(760px 420px at 6% 118%, rgba(27, 140, 255, .14), transparent 60%),
    #0a1324;
}
.hero-inner {
  max-width: 1140px; margin: 0 auto; padding: clamp(2.75rem, 6vw, 5rem) 1rem;
  display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 992px) { .hero-inner { grid-template-columns: 1.05fr .95fr; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.25rem;
  font-size: .85rem; font-weight: 600; padding: .3rem .8rem; border-radius: 50rem;
  color: #9fd0ff; background: rgba(27, 140, 255, .15); border: 1px solid rgba(27, 140, 255, .28);
}
.hero-title { font-size: clamp(2.2rem, 5.5vw, 3.8rem); font-weight: 800; line-height: 1.05; letter-spacing: -.025em; margin: 0 0 1rem; }
.hero-lead { font-size: 1.1rem; color: #b7c2d2; max-width: 31rem; margin: 0 0 1.85rem; line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-btn { background: var(--brand-accent); color: #06182e; border: 0; font-weight: 700; box-shadow: 0 12px 28px rgba(27, 140, 255, .35); }
.hero-btn:hover { background: #3aa3ff; color: #06182e; }
.hero-btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.hero-btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; padding: 0; margin: 1.85rem 0 0; }
.hero-points li { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: #aeb9c9; }
.hero-points .icon { color: var(--brand-accent); }

/* Entrada orquestrada (uma única vez, ao carregar) */
.hero-copy > *, .hero-visual { opacity: 0; animation: fadeUp .7s ease forwards; }
.hero-copy > *:nth-child(1) { animation-delay: .05s; }
.hero-copy > *:nth-child(2) { animation-delay: .13s; }
.hero-copy > *:nth-child(3) { animation-delay: .21s; }
.hero-copy > *:nth-child(4) { animation-delay: .29s; }
.hero-copy > *:nth-child(5) { animation-delay: .37s; }
.hero-visual { animation-delay: .2s; }

/* Visual: arco azul + terminal + acentos */
.hero-visual { display: none; }
@media (min-width: 992px) {
  .hero-visual { display: grid; place-items: center; position: relative; min-height: 27rem; }
}
.hero-arch {
  width: 19rem; height: 23.5rem; position: relative;
  border-radius: 10rem 10rem 1.5rem 1.5rem;
  background: radial-gradient(135% 95% at 50% 12%, #36a4ff 0%, #1b74d8 46%, #0c3f86 100%);
  box-shadow: 0 34px 80px rgba(8, 24, 60, .55), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.hero-terminal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 24rem; max-width: 92%; text-align: left; overflow: hidden;
  background: #0b1526; border: 1px solid rgba(255, 255, 255, .1); border-radius: .85rem;
  box-shadow: 0 26px 54px rgba(4, 14, 34, .6);
}
.term-bar {
  display: flex; align-items: center; gap: .4rem; padding: .55rem .85rem;
  background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .07);
  font: 600 .72rem/1 var(--font-mono); color: #8aa0be;
}
.term-bar i { width: .62rem; height: .62rem; border-radius: 50%; background: #3a4a63; }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: .45rem; }
.term-body { margin: 0; padding: .95rem 1.05rem 1.15rem; font: .82rem/1.75 var(--font-mono); color: #cdd9ea; white-space: pre-wrap; }
.t-dim { color: #647a9b; }
.t-ok { color: #4fd88a; }
.t-flag { color: #ffc24b; }
.t-win { color: #5db4ff; font-weight: 600; }
.term-cursor { display: inline-block; width: .55em; height: 1.05em; vertical-align: -.17em; background: var(--brand-accent); animation: blink 1.05s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-sticker {
  position: absolute; top: 1rem; right: .5rem; z-index: 2;
  padding: .45rem .85rem; border-radius: 50rem; transform: rotate(-9deg);
  background: #ffc24b; color: #3a2a00; font-weight: 700; font-size: .82rem;
  box-shadow: 0 10px 22px rgba(255, 194, 75, .35);
}
.hero-spark { position: absolute; width: 1.1rem; height: 1.1rem; background: #fff; opacity: .9;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.hero-spark-1 { top: 2.5rem; left: 1.5rem; }
.hero-spark-2 { bottom: 3rem; right: 2.5rem; width: .8rem; height: .8rem; opacity: .7; }
.hero-dot { position: absolute; bottom: 1.5rem; left: 3.5rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--brand-accent); box-shadow: 0 0 0 .4rem rgba(27, 140, 255, .18); }

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-visual { opacity: 1; animation: none; }
  .term-cursor { animation: none; }
}

/* Secção dos cursos em destaque */
.section-courses { margin: 3.5rem auto; }
.courses-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }

/* Secções */
.section-title { font-weight: 700; letter-spacing: -.01em; }
.feature-card {
  background: #fff; border: 1px solid #e6eaf0; border-radius: .8rem; padding: 1.5rem;
  transition: transform .18s ease, box-shadow .18s ease; height: 100%;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(16,36,64,.1); }
.feature-card .feature-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem;
  border-radius: .7rem; background: var(--brand-accent-soft); color: var(--brand); font-size: 1.4rem; margin-bottom: 1rem;
}

/* ===================================================================== *
 * Cartões de curso — catálogo, destaques e área do aluno (unificados)   *
 * ===================================================================== */
.course-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.course-card {
  display: flex; flex-direction: column; position: relative; height: 100%;
  background: var(--surface); border: 1px solid var(--line, var(--border));
  border-radius: .85rem; overflow: hidden; color: inherit; text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.course-card:hover {
  transform: translateY(-3px); border-color: #cdd7e4;
  box-shadow: 0 12px 28px rgba(16, 36, 64, .1);
}

/* Capa: imagem, ou fundo tingido pelo nível quando não há capa. */
.course-cover-art {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.course-cover-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-cover-art.lvl-beginner    { background: linear-gradient(135deg, #0a2647 0%, #0b4f8a 60%, #1366b8 100%); }
.course-cover-art.lvl-intermediate { background: linear-gradient(135deg, #06344a 0%, #0c5a78 55%, #1aa0b8 100%); }
.course-cover-art.lvl-advanced     { background: linear-gradient(135deg, #281852 0%, #46288a 55%, #6a4bd0 100%); }
.course-cover-mark { color: rgba(255, 255, 255, .5); font-size: 3rem; }
.course-cover-mark .icon { width: 1em; height: 1em; }
.course-cover-level {
  position: absolute; top: .6rem; right: .6rem;
  padding: .2rem .6rem; border-radius: 50rem; font-size: .72rem; font-weight: 600;
  color: #fff; background: rgba(8, 25, 46, .55); backdrop-filter: blur(3px);
}

.course-card-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1rem 1.1rem 1.15rem; }
.course-card-cat { font-size: .78rem; color: var(--muted); margin: 0 0 .25rem; }
.course-card-title { font-size: 1.05rem; font-weight: 600; line-height: 1.3; margin: 0 0 .4rem; }
.course-card-title a { color: var(--fg); text-decoration: none; }
.course-card:hover .course-card-title a { color: var(--brand); }
.course-card-desc {
  font-size: .9rem; color: var(--muted); margin: 0 0 .9rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card-meta {
  display: flex; align-items: center; gap: .4rem; margin: auto 0 0;
  font-size: .82rem; color: var(--muted);
}
.course-card-meta .icon { color: var(--brand-accent); }
.course-card-progress { margin: auto 0 .35rem; }
.course-card-progress-label { display: block; margin-top: .3rem; font-size: .8rem; color: var(--muted); }
.course-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-top: .5rem; flex-wrap: wrap;
}

/* Cabeçalhos da área do aluno */
.student-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1rem; margin-bottom: 1.5rem;
}
.section-head {
  display: flex; align-items: center; gap: .45rem;
  font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 1rem;
}
.section-head .icon { color: var(--brand-accent); }

@media (prefers-reduced-motion: reduce) { .course-card { transition: none; } .course-card:hover { transform: none; } }

/* Skeleton (placeholder de carregamento) */
.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #e2e8f1 37%, #eef2f7 63%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.skeleton img { opacity: 0; }

/* ===================================================================== *
 * Certificado (público / imprimível)                                    *
 * ===================================================================== */
.certificate {
  max-width: 52rem; margin: 0 auto; background: #fff;
  border: 1px solid #e6eaf0; border-radius: 1rem; box-shadow: 0 10px 30px rgba(16,36,64,.08);
  padding: .5rem;
}
.certificate-inner {
  border: 2px solid var(--brand); border-radius: .75rem; padding: clamp(1.5rem, 5vw, 3.5rem);
  text-align: center;
  background:
    radial-gradient(800px 240px at 50% -20%, rgba(27,140,255,.08), transparent 70%);
}
.certificate-revoked .certificate-inner { border-color: #c23; opacity: .85; }
.certificate-brand img { height: 3.25rem; width: auto; margin-bottom: 1.25rem; }
.certificate-kicker {
  text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; font-weight: 700;
  color: var(--brand); margin-bottom: 1.5rem;
}
.certificate-text { color: var(--muted); margin-bottom: .35rem; }
.certificate-name {
  font-size: clamp(1.75rem, 5vw, 2.75rem); font-weight: 700; color: var(--brand-dark);
  letter-spacing: -.01em; margin-bottom: 1rem; line-height: 1.1;
}
.certificate-course { font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 600; margin-bottom: 1rem; }
.certificate-meta { color: var(--muted); margin-bottom: 2rem; }
.certificate-footer {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: end;
  border-top: 1px solid #e6eaf0; padding-top: 1.25rem; text-align: left; font-size: .85rem;
}
.certificate-label { display: block; text-transform: uppercase; letter-spacing: .08em;
  font-size: .7rem; color: var(--muted); }
.certificate-footer code { color: var(--brand-dark); font-weight: 600; }

/* ===================================================================== *
 * Desempenho do aluno                                                   *
 * ===================================================================== */
.perf-hero {
  display: grid; gap: 1.5rem; align-items: center; margin-bottom: 2.25rem;
  grid-template-columns: auto 1fr;
  padding: 1.5rem; border: 1px solid var(--border); border-radius: 1rem;
  background:
    radial-gradient(520px 200px at 0% 0%, rgba(27, 140, 255, .06), transparent 70%),
    var(--surface);
}
.perf-ring { text-align: center; }
.perf-ring svg { display: block; margin: 0 auto; }
.perf-ring-track { stroke: #e9eef4; }
.perf-ring-value { stroke: var(--brand-accent); transition: none; }
.perf-ring-num { font-size: 1.6rem; font-weight: 700; fill: var(--fg); text-anchor: middle; }
.perf-ring-cap { font-size: .62rem; fill: var(--muted); text-anchor: middle; letter-spacing: .02em; }
.perf-ring-detail { margin: .6rem 0 0; font-size: .82rem; color: var(--muted); }

.perf-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.perf-stat {
  border: 1px solid var(--border); border-radius: .7rem; padding: .9rem 1rem;
  background: var(--surface);
}
.perf-stat-num { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--fg); }
.perf-stat-label { display: block; margin-top: .3rem; font-size: .8rem; color: var(--muted); }
.perf-stat-gold .perf-stat-num { color: #b7791f; }

.perf-list { display: flex; flex-direction: column; gap: .75rem; }
.perf-row {
  display: grid; align-items: center; gap: .5rem 1.5rem;
  grid-template-columns: minmax(12rem, 1.3fr) minmax(10rem, 1fr) auto;
  border: 1px solid var(--border); border-radius: .75rem; padding: 1rem 1.15rem;
  background: var(--surface);
}
.perf-row-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.perf-row-title { font-size: 1rem; font-weight: 600; margin: 0; }
.perf-row-title a { color: var(--fg); text-decoration: none; }
.perf-row-title a:hover { color: var(--brand); }
.perf-metric-top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.perf-metric-top .icon { color: var(--brand-accent); }
.perf-metric-val { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.perf-chips { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.perf-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .6rem; border-radius: 50rem; font-size: .78rem; color: var(--muted);
  background: var(--surface-2); border: 1px solid transparent; white-space: nowrap;
}
.perf-chip strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.perf-chip .icon { color: var(--brand-accent); }
.perf-chip-cert {
  color: #8a5a00; background: #fdf3dc; text-decoration: none; font-weight: 600;
}
.perf-chip-cert .icon { color: #b7791f; }
.perf-chip-cert:hover { background: #fbe9bf; }

@media (max-width: 720px) {
  .perf-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .perf-stats { width: 100%; }
  .perf-row { grid-template-columns: 1fr; }
  .perf-chips { justify-content: flex-start; }
}

@media print {
  .no-print, header, footer, .skip-link { display: none !important; }
  body { background: #fff; }
  .certificate { box-shadow: none; border: 0; max-width: 100%; }
  main, .container { padding: 0 !important; }
  @page { margin: 1.5cm; }
}

/* ------------------------------------------- cartão de inscrição (detalhe do curso) */
.course-enroll { box-shadow: 0 .5rem 1.5rem rgba(16, 36, 64, .08); }
@media (min-width: 992px) { .course-enroll { position: sticky; top: 1.5rem; } }
.course-enroll-price { margin: 0 0 1rem; font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--fg); }
.course-enroll-price.is-free { color: var(--success); }
.course-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem;
  margin: 0;
}
.course-facts > div {
  display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: center;
  padding: .55rem .65rem; border-radius: .45rem; background: var(--surface-tertiary);
}
.course-facts > div.is-wide { grid-column: 1 / -1; }
.course-facts .icon { grid-row: span 2; width: 1.15rem; height: 1.15rem; color: var(--brand-accent); }
.course-facts dt { font-size: .72rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.course-facts dd { margin: 0; font-size: .92rem; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }

/* Seletor de idioma (i18n): <select> moderno, com seta própria (data-URI, permitida pela CSP). */
.lang-switch { display: inline-flex; align-items: center; }
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  color: #fff;
  background-color: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: .45rem;
  padding: .25rem 1.7rem .25rem .6rem;
  font-size: .82rem;
  line-height: 1.3;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  background-size: .7rem;
  transition: background-color .15s ease, border-color .15s ease;
}
.lang-select:hover { background-color: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .6); }
.lang-select:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.lang-select option { color: #1a1a1a; }  /* a lista abre com o estilo do sistema (texto escuro) */

/* Variante para fundo claro (ex.: sidebar do staff). */
.lang-switch--light .lang-select {
  color: var(--brand, #1a1a2e);
  background-color: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
}
.lang-switch--light .lang-select:hover { background-color: rgba(0, 0, 0, .08); }

.staff-sidebar-lang { margin-top: .6rem; }

/* Estrutura do curso: arrastar módulos e aulas */
.drag-handle { cursor: grab; color: var(--bs-secondary-color); display: inline-flex; touch-action: none; }
[data-item].is-dragging { opacity: .45; }
[data-item].drop-before { box-shadow: 0 -3px 0 0 var(--bs-primary, #0d6efd); }
[data-item].drop-after { box-shadow: 0 3px 0 0 var(--bs-primary, #0d6efd); }
details > summary.card-header { cursor: pointer; }
li.list-group-item[data-item] { display: flex; }

.perf-class-progress { min-width: 9rem; }

/* --------------------------------------------------------------- chat */
.chat {
  display: grid; grid-template-columns: 16rem minmax(0, 1fr) 14rem; gap: 0;
  height: calc(100vh - 4rem); min-height: 30rem;
  border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); overflow: hidden;
}
.chat-rooms, .chat-members { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--surface-tertiary); }
.chat-rooms { border-right: 1px solid var(--border); }
.chat-members { border-left: 1px solid var(--border); }
.chat-pane-title { font-size: 1.1rem; margin: 0; padding: 1rem 1rem .5rem; }
.chat-pane-title-sm { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.chat-room-list { display: flex; flex-direction: column; padding: .25rem .5rem; gap: .125rem; }
.chat-room {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: .5rem;
  color: var(--fg); text-decoration: none; position: relative;
}
.chat-room:hover { background: var(--surface-2); }
.chat-room.active { background: var(--brand-accent-soft); font-weight: 600; }
.chat-room.active::before { content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 2px; background: var(--brand-accent); }
.chat-room-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-badge {
  background: var(--brand-accent); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; display: inline-flex; align-items: center; justify-content: center;
}
.chat-badge[hidden], .staff-nav-badge[hidden] { display: none; }
.chat-create { margin-top: auto; padding: .75rem; border-top: 1px solid var(--border); }
.chat-create-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .5rem; }
.chat-create-item { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .85rem; }

.chat-avatar {
  position: relative; flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .9rem;
}
.chat-avatar-room { border-radius: .55rem; background: var(--brand-accent); }
.chat-avatar-sm { width: 1.8rem; height: 1.8rem; font-size: .78rem; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-main-empty { justify-content: center; }
.chat-header { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.chat-header-text { flex: 1; min-width: 0; }
.chat-title { font-size: 1.05rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-subtitle { margin: 0; font-size: .78rem; color: var(--muted); }
.chat-members-toggle { display: none; }
.chat-offline { background: #fff4d6; color: #7a5200; text-align: center; font-size: .82rem; padding: .35rem; }
.chat-offline[hidden] { display: none; }

.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: .75rem 1rem; display: flex; flex-direction: column; }
.chat-loading, .chat-empty { margin: auto; color: var(--muted); font-size: .9rem; }
.chat-older { align-self: center; margin-bottom: .75rem; }
.chat-day { align-self: center; margin: .9rem 0 .5rem; padding: .1rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 600; }
.chat-msg { position: relative; display: flex; gap: .65rem; padding: .35rem .5rem; margin-top: .35rem; border-radius: .5rem; }
.chat-msg:hover { background: var(--surface-tertiary); }
.chat-msg-grouped { margin-top: 0; padding-top: .05rem; padding-bottom: .05rem; }
.chat-msg-grouped .chat-avatar { visibility: hidden; height: 0; }
.chat-msg-grouped .chat-msg-head { display: none; }
.chat-msg-mine .chat-avatar { background: var(--brand-accent); }
.chat-msg-body { min-width: 0; flex: 1; }
.chat-msg-head { display: flex; align-items: baseline; gap: .5rem; }
.chat-msg-author { font-weight: 600; font-size: .9rem; }
.chat-msg-time, .chat-msg-edited { font-size: .72rem; color: var(--muted); }
.chat-msg-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-msg-deleted .chat-msg-text { color: var(--muted); font-style: italic; }
.chat-msg-tools { position: absolute; right: .5rem; top: -.7rem; display: none; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: .4rem; padding: .1rem; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.chat-msg:hover .chat-msg-tools, .chat-msg:focus-within .chat-msg-tools { display: flex; }
.chat-tool { border: 0; background: none; font-size: .75rem; padding: .2rem .5rem; border-radius: .3rem; color: var(--fg); cursor: pointer; }
.chat-tool:hover { background: var(--surface-2); }
.chat-tool-danger { color: var(--danger); }
.chat-edit-input { width: 100%; resize: vertical; border: 1px solid var(--brand-accent); border-radius: .5rem; padding: .4rem .6rem; font: inherit; }
.chat-edit-bar { display: flex; gap: .4rem; margin-top: .35rem; }

.chat-typing { min-height: 1.4rem; margin: 0; padding: 0 1rem; font-size: .78rem; color: var(--muted); font-style: italic; }
.chat-typing.is-active:not(.is-error)::after { content: ""; display: inline-block; width: .9rem; margin-left: .15rem; animation: chat-dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
.chat-typing.is-error { color: var(--danger); font-style: normal; }
@keyframes chat-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .chat-typing.is-active::after { animation: none; } }

.chat-composer { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem 1rem 1rem; }
.chat-composer textarea {
  flex: 1; resize: none; max-height: 10rem; border: 1px solid var(--border); border-radius: .75rem;
  padding: .6rem .85rem; font: inherit; line-height: 1.4; background: var(--surface);
}
.chat-composer textarea:focus { outline: 2px solid var(--brand-accent); outline-offset: -1px; border-color: transparent; }

.chat-member-list { list-style: none; margin: 0; padding: 0 .5rem 1rem; }
.chat-member { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem; font-size: .88rem; border-radius: .4rem; }
.chat-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-you { color: var(--muted); font-size: .75rem; }
.chat-role { font-size: .65rem; text-transform: uppercase; letter-spacing: .03em; color: var(--brand); background: var(--brand-accent-soft); border-radius: .3rem; padding: .05rem .35rem; }
.chat-dot { position: absolute; right: -2px; bottom: -2px; width: .65rem; height: .65rem; border-radius: 50%; background: #aab4c0; border: 2px solid var(--surface-tertiary); }
.chat-member.is-online .chat-dot { background: #2eb85c; }
.chat-member:not(.is-online) .chat-member-name { color: var(--muted); }

@media (max-width: 991.98px) {
  .chat { grid-template-columns: 12rem minmax(0, 1fr); }
  .chat-members { display: none; grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); max-height: 12rem; }
  .chat-members-open .chat-members { display: flex; }
  .chat-members-toggle { display: inline-flex; }
}
@media (max-width: 575.98px) {
  .chat { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat-rooms { border-right: 0; border-bottom: 1px solid var(--border); max-height: 11rem; }
  .chat-main { height: 70vh; }
}
