/* Kiube — folha de estilos única */
:root {
    --brand-1: #6b57ff;
    --brand-2: #b74af7;
    --brand-3: #ff318c;
    --brand-1-rgb: 107 87 255;
    --brand-2-rgb: 183 74 247;
    --brand-3-rgb: 255 49 140;
    --brand-1-soft: #8f7dff;
    --brand-3-soft: #ff5fa8;
    --brand-text: #5a45e6; /* texto pequeno de cor da marca (contraste >= 4,5:1 sobre o fundo) */
    --gradient: linear-gradient(90deg, var(--brand-1) 2%, var(--brand-2) 42%, var(--brand-3) 75%);
    --ink: #1a242e;       /* superfícies escuras fixas (menu lateral, chips ativos) */
    --ink-2: #263644;
    --heading: #1a242e;   /* títulos e texto de destaque */
    --text: #2b3642;
    --text-2: #4a5766;
    --muted: #5f6b78;
    --muted-2: #8a94a1;
    --line: #e6e9ee;
    --line-2: #eef0f6;
    --line-3: #d5dae1;
    --bg: #f4f5f9;
    --card: #ffffff;
    --soft: #f5f6fa;
    --soft-2: #fafbfe;
    --tint: color-mix(in srgb, var(--brand-1) 9%, #fff);
    --nav-text: #c6cfd9;
    --logo-ink: #1a242e;
    --ok: #12a05c;
    --warn: #d98a00;
    --danger: #d83a52;
    --ok-text: #0b7a47;
    --warn-text: #8a5a00;
    --danger-text: #b3263f;
    --ok-bg: #f0faf5;
    --warn-bg: #fff3d6;
    --warn-line: #f2d58c;
    --danger-bg: #fdecef;
    --danger-line: #f6c3cc;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(26, 36, 46, .06), 0 4px 16px rgba(26, 36, 46, .05);
    --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
/* Reserva a calha da barra de rolagem: nada muda de lugar entre páginas com e sem rolagem vertical. */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
body {
    font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--heading); }
.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { background: var(--line-2); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--ink); color: var(--nav-text);
    display: flex; flex-direction: column; padding: 20px 14px; z-index: 30;
}
.sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.sidebar-logo { display: block; padding: 6px 10px 22px; }
.sidebar-logo img, .sidebar-logo svg { height: 42px; width: auto; display: block; }
.app-version { display: block; margin: 5px 0 0 2px; font-size: 11.5px; letter-spacing: .02em; color: rgb(255 255 255 / .55); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
/* Grupo recolhível (Administração) */
.nav-group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 14px 0 4px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: #7d8ea0; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.nav-group-toggle:hover { color: #fff; background: var(--ink-2); }
.nav-group-toggle .icon { transition: transform .2s; }
.nav-group-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.nav-group-body { display: none; flex-direction: column; gap: 2px; }
.nav-group-body.is-open { display: flex; }
/* Subgrupos do menu de administração */
.nav-sub { margin: 12px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5f7083; }
.nav-group-body > .nav-sub:first-child { margin-top: 2px; }
/* Barra de rolagem do menu: fina e discreta, aparece mais ao passar o mouse */
.nav { scrollbar-width: thin; scrollbar-color: transparent transparent; margin-right: -8px; padding-right: 8px; }
.nav:hover { scrollbar-color: #3b4a5a transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.nav:hover::-webkit-scrollbar-thumb { background: #3b4a5a; }
.nav::-webkit-scrollbar-thumb:hover { background: #55677a; }
@media (max-height: 820px) { .nav-link { padding-block: 8px; } }
.nav-title { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6f7f90; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--nav-text); font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav-link.is-active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand-2); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid #2c3a49; margin-top: 12px; }
.sidebar-user .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { color: #8a99a8; font-size: 12px; }
/* Foto de perfil com anel nas cores do tema */
.avatar-ring { --ring-gap: #fff; width: var(--av, 36px); height: var(--av, 36px); padding: max(2px, calc(var(--av, 36px) * .06)); border-radius: 50%; background: conic-gradient(from 200deg, var(--brand-1), var(--brand-2), var(--brand-3), var(--brand-1)); display: inline-flex; flex: none; box-sizing: border-box; }
.avatar-ring > img, .avatar-ring > span { width: 100%; height: 100%; border-radius: 50%; border: max(2px, calc(var(--av, 36px) * .045)) solid var(--ring-gap); box-sizing: border-box; object-fit: cover; background: var(--ink); }
.avatar-ring > span { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--av, 36px) * .42); }
.sidebar-user .avatar-ring { --ring-gap: var(--ink); }
.sidebar-me { display: inline-flex; border-radius: 50%; }
.sidebar-user .who a:hover strong { text-decoration: underline; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
.sidebar-user .icon-btn { color: var(--nav-text); }
.sidebar-user .icon-btn:hover { background: var(--ink-2); color: #fff; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 32px 0; }
.topbar h1 { font-size: 22px; }
.menu-btn { display: none; }
.content { padding: 20px 32px 48px; width: 100%; } /* sem largura máxima: ocupa toda a página (com ou sem coluna lateral) */
.scrim { display: none; }

/* ---------- Componentes ---------- */
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px;
    background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--line-2); color: var(--heading); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
    border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: transform .05s, box-shadow .15s, background .15s; text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--gradient); background-origin: border-box; background-repeat: no-repeat; color: #fff; box-shadow: 0 4px 14px rgb(var(--brand-2-rgb) / .35); }
.btn-brand:hover { box-shadow: 0 6px 18px rgb(var(--brand-2-rgb) / .5); }
.btn-ghost { background: var(--card); color: var(--heading); border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); }
.btn-ghost.is-fav { color: #c98a00; border-color: var(--warn-line); background: var(--warn-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--card)); color: var(--ok-text); }
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-text); }
.alert-info { background: var(--tint); border-color: color-mix(in srgb, var(--brand-1) 30%, var(--card)); color: var(--brand-text); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; background: var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok-text); }
.pill-danger { background: var(--danger-bg); color: var(--danger-text); }
.pill-warn { background: var(--warn-bg); color: var(--warn-text); }
.pill-muted { background: var(--line-2); color: var(--muted); }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.panel.narrow { max-width: 680px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.block { margin-bottom: 30px; }
.block-title { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.count { font-size: 12px; background: var(--line); color: #55607a; border-radius: 99px; padding: 1px 9px; font-weight: 600; }

/* Barra de busca e chips */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 22px; justify-content: space-between; }
.search { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search .icon { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); }
.search input:focus, .field input:focus, .field select:focus, .editor:focus { outline: 2px solid rgb(var(--brand-1-rgb) / .35); border-color: var(--brand-1); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }
.chip:hover { text-decoration: none; background: var(--soft); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Cartões de itens */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; align-items: stretch; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26, 36, 46, .1); }
.card-main { flex: 1; display: flex; gap: 14px; padding: 16px; min-width: 0; color: inherit; }
.card-main:hover { text-decoration: none; }
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; background: var(--gradient); }
.type-pdf .card-icon { background: linear-gradient(135deg, #ff6a5f, #e8365d); }
.type-video .card-icon { background: linear-gradient(135deg, #ff9a3c, #ff5f6d); }
.type-image .card-icon { background: linear-gradient(135deg, #2dc7a3, #1a9bd7); }
.type-link .card-icon { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.type-content .card-icon { background: linear-gradient(135deg, var(--muted), var(--text-2)); }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-text strong { color: var(--heading); font-size: 15px; overflow-wrap: anywhere; }
.card-text small { color: var(--muted); font-size: 13px; display:-webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-text em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9aa5b1; margin-top: 6px; }
.fav { border: 0; background: transparent; color: var(--line-3); cursor: pointer; padding: 12px 12px 0 0; }
.fav:hover { color: #e0a800; }
.fav.is-on { color: #f0b400; }
.fav.is-on svg { fill: currentColor; }

/* Ranking */
.ranking { display: flex; flex-wrap: wrap; gap: 14px; }
.rank { position: relative; flex: 1; min-width: 200px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 16px 64px; display: flex; flex-direction: column; }
.rank-pos { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--heading); }
/* medalhas: texto escuro sobre ouro, prata e bronze (contraste >= 4,5:1) */
.rank-gold .rank-pos { background: #f5c518; } .rank-silver .rank-pos { background: var(--line-3); } .rank-bronze .rank-pos { background: #d98d4a; }
.rank small { color: var(--muted); }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h3 { color: var(--heading); margin: 12px 0 4px; }

/* Visualizador */
.viewer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.viewer-meta { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-actions form { margin: 0; }
.stage { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; height: calc(100vh - 170px); min-height: 480px; }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage--image { height: auto; display: grid; place-items: center; padding: 14px; }
.stage--image img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.article { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 40px; max-width: 820px; }
.article h2 { font-size: 28px; }
.article-meta { color: var(--muted); font-size: 13px; margin: 6px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.article-body img { max-width: 100%; height: auto; }
.article-body table { border-collapse: collapse; } .article-body td, .article-body th { border: 1px solid var(--line); padding: 6px 10px; }
.article-body blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid var(--brand-2); color: #55606b; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin: 0; }

/* Formulários */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--heading); }
.field small, .hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.field input, .field select, .field textarea, .filter, .inline-form input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line-3); border-radius: 10px; font: inherit; background: var(--card); color: var(--text);
}
.field input:disabled { background: var(--soft); color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { font-size: 14px; margin: 20px 0 10px; }
.panel > .form-section:first-child { margin-top: 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.check input { width: auto; accent-color: var(--brand-1); }
.checklist .check { flex-wrap: wrap; row-gap: 0; }
.checklist .check small { flex-basis: 100%; padding-left: 24px; margin-top: -3px; }
.checklist { max-height: 260px; overflow-y: auto; padding-right: 4px; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }
.filter { margin: 6px 0 8px; padding: 7px 10px; font-size: 13px; }
.inline-form { display: flex; align-items: center; gap: 10px; }
.inline-form input[type=text] { flex: 1; }
.narrow-input { width: 80px !important; }

.editor-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--soft); border: 1px solid var(--line-3); border-bottom: 0; border-radius: 10px 10px 0 0; }
.editor-bar button { border: 0; background: var(--card); border-radius: 7px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.editor-bar button:hover { background: var(--line); }
.editor { min-height: 260px; padding: 14px; border: 1px solid var(--line-3); border-radius: 0 0 10px 10px; background: var(--card); line-height: 1.65; }

/* Login */
.login-body { background: var(--ink); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art {
    position: relative; overflow: hidden; display: flex; align-items: center; padding: 56px; color: #fff;
    background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand-1) 70%, #000) 0%, transparent 60%), linear-gradient(160deg, #1a242e 0%, color-mix(in srgb, var(--brand-1) 22%, #1a242e) 100%);
}
.login-art::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient); }
.art-inner { position: relative; z-index: 1; max-width: 520px; }
.art-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .3px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.login-art h2 { color: #fff; font-size: 38px; font-weight: 800; line-height: 1.15; margin: 20px 0 14px; }
.login-art h2 em { font-style: normal; background: linear-gradient(90deg, color-mix(in srgb, var(--brand-1-soft) 75%, #fff), var(--brand-3-soft)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #c9d0e4; font-size: 16px; margin: 0 0 30px; }
.art-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.art-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.art-list li > span { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--gradient); }
.art-list strong { display: block; font-size: 15px; }
.art-list small { color: #b9c1d9; font-size: 13px; }
.art-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.art-orb-1 { width: 320px; height: 320px; background: var(--brand-2); right: -90px; bottom: -80px; }
.art-orb-2 { width: 220px; height: 220px; background: var(--brand-3); left: -70px; bottom: 15%; opacity: .25; }
.login-panel { background: var(--card); display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { height: 60px; width: auto; margin-bottom: 22px; }
.login-title { font-size: 24px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin: 0 0 22px; }
.login-foot { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }
.login-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -4px 0 20px; font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }
.check input { accent-color: var(--brand-1); width: 16px; height: 16px; margin: 0; }
.pass { position: relative; }
.pass input { padding-right: 44px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.pass-toggle:hover, .pass-toggle.is-on { color: var(--brand-1); }

/* Erro */
.error-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.error-box { text-align: center; padding: 24px; max-width: 460px; }
.error-code { font-size: 84px; font-weight: 700; line-height: 1.1; margin-top: 18px; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-box p { color: var(--muted); }
.error-box .btn { margin-top: 14px; }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .sidebar.is-open { transform: none; }
    .scrim.is-open { display: block; position: fixed; inset: 0; background: rgba(10, 16, 24, .5); z-index: 20; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 14px 16px 0; } .topbar h1 { font-size: 19px; }
    .content { padding: 16px 16px 40px; }
    .two { grid-template-columns: 1fr; }
    .article { padding: 22px 20px; }
    .grid-2 { grid-template-columns: 1fr; }
    .login { grid-template-columns: 1fr; } .login-art { display: none; }
    .stage { height: calc(100vh - 220px); }
}

/* Upload de arquivos */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; margin-top: 10px; text-align: center; border: 2px dashed var(--line-3); border-radius: 14px; background: var(--soft-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand-1); background: var(--tint); color: var(--brand-1); }
.dropzone strong { color: var(--heading); font-size: 14px; overflow-wrap: anywhere; }
.dropzone small { font-size: 12.5px; }
.dropzone:focus-within { border-color: var(--brand-1); background: var(--tint); outline: 2px solid rgb(var(--brand-1-rgb) / .35); outline-offset: 2px; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.file-current { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft-2); }
.file-current > div { flex: 1; min-width: 0; }
.file-current strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.file-current small { margin: 0; }
.stage--video { height: auto; background: #000; display: grid; place-items: center; }
.stage--video video { width: 100%; max-height: calc(100vh - 170px); display: block; }
.file-card { max-width: 520px; margin: 40px auto; padding: 40px 32px; text-align: center; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.file-card-icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #3b82f6, #6366f1); margin-bottom: 14px; }
.file-card h2 { margin-bottom: 6px; }
.file-card p { margin: 0 0 8px; color: var(--muted); }
.file-card .btn { margin-top: 12px; }
.type-file .card-icon { background: linear-gradient(135deg, #3b82f6, #6366f1); }

/* Menu lateral recolhido (computador) */
@media (min-width: 821px) {
    .sidebar, .main { transition: width .2s, margin-left .2s, padding .2s; }
    body.nav-collapsed { --sidebar-w: 76px; }
    body.nav-collapsed .sidebar { padding-inline: 10px; }
    body.nav-collapsed .sidebar-logo { padding-inline: 8px; }
    body.nav-collapsed .sidebar-logo img { width: 40px; height: 40px; object-fit: cover; object-position: left center; }
    body.nav-collapsed .sidebar-logo svg { width: 40px; height: 40px; }
    body.nav-collapsed .app-version { display: none; }
    body.nav-collapsed .nav-link { justify-content: center; padding-inline: 0; position: relative; }
    body.nav-collapsed .nav-link span { display: none; }
    body.nav-collapsed .nav-sub { height: 1px; margin: 8px 18px; padding: 0; font-size: 0; background: #2c3a49; overflow: hidden; }
    body.nav-collapsed .nav-title { height: 1px; margin: 12px 14px; font-size: 0; background: #2c3a49; }
    body.nav-collapsed .nav-group-toggle { height: 1px; margin: 12px 14px; padding: 0; width: auto; background: #2c3a49; pointer-events: none; }
    body.nav-collapsed .nav-group-toggle span, body.nav-collapsed .nav-group-toggle .icon { display: none; }
    body.nav-collapsed .nav-group-body { display: flex; }
    body.nav-collapsed .nav-badge { position: absolute; top: 2px; right: 6px; }
    body.nav-collapsed .sidebar-user { flex-direction: column; padding-inline: 0; gap: 8px; }
    body.nav-collapsed .sidebar-user .who { display: none; }
}

/* Acessibilidade comum */
:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 12px; text-decoration: none; }
.content:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, var(--brand-3) 78%, #000); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }

/* ---------- Distribuição de largura (auditoria) ---------- */
/* Teto para telas ultra-largas: topbar e conteúdo (com a coluna lateral) ficam centralizados e alinhados entre si. */
.topbar, .content { width: 100%; max-width: 1800px; margin-inline: auto; }

/* Textos de leitura: o cartão ocupa toda a largura útil e o texto fica numa coluna legível, centralizada. */
.article { max-width: none; padding: 34px clamp(24px, 5vw, 72px); }
.article > h2, .article > .article-meta, .article > .article-body, .article > .news-cover, .article > .pill, .article > p, .article > .btn { max-width: 780px; margin-left: auto; margin-right: auto; }
.article > .news-cover, .news-article .news-cover { display: block; max-width: 780px; width: 100%; }
.news-article { max-width: none; }

/* Formulários simples (perfil, usuário, grupo): ocupam a largura útil em duas colunas. */
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.cols-2 > .panel { margin-bottom: 0; }
.cols-2 > .actions { grid-column: 1 / -1; margin-top: 0; }
.panel .two + .field, .panel .field + .two { margin-top: 0; }
.checklist--cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 18px; max-height: 420px; }
@media (max-width: 900px) { .cols-2 { grid-template-columns: 1fr; } }
.field-short { max-width: 520px; }
.form-grid > * { min-width: 0; }
.filter { max-width: 420px; }
.panel:has(> table), .panel:has(> .table-scroll) { overflow-x: auto; }
.cover-thumb { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; } /* miniatura de capa nos formulários (antes só carregava em páginas de curso/biblioteca) */

/* Seletor de pessoas (busca no servidor) */
.people-picker { position: relative; }
.people-picker .filter { max-width: none; width: 100%; margin-top: 8px; }
.pp-results { position: absolute; left: 0; right: 0; z-index: 20; margin: -4px 0 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--line-3); border-radius: 10px; box-shadow: var(--shadow); }
.pp-results[hidden] { display: none; }
.pp-results button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.pp-results button:hover, .pp-results button:focus-visible { background: var(--tint); }
.pp-none { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.pp-chosen { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; }
.pp-chosen li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 99px; background: var(--tint); color: var(--brand-text); font-size: 13.5px; }
.pp-remove { border: 0; width: 22px; height: 22px; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.pp-remove:hover, .pp-remove:focus-visible { background: rgb(var(--brand-1-rgb) / .18); }
.pp-empty[hidden] { display: none; }
