/* Kosm — Portal de Entregas. CSS puro, sem frameworks. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/archivo-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/archivo-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --ink: #191919; --paper: #F1EDE9; --white: #FFFFFF;
  --ink-2: #4a4743; --ink-3: #7d7873; --line: #ddd7d0; --line-soft: #ebe7e2;
  --ok: #2d6a3e; --warn: #8a5a00; --bad: #a3322a; --active: #191919;
  --side-w: 256px; --r: 3px;
  --f: "Archivo", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-meta: 0.8125rem; --t-ui: 0.9375rem; --t-read: 1.0625rem; --t-h3: 1.125rem; --t-h2: 1.375rem; --t-h1: 1.75rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--t-ui)/1.55 var(--f); color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
p { margin: 0 0 1em; } a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 28px 0 20px; }
.side .brand { padding: 0 28px 28px; display: block; text-decoration: none; }
.brand-text { font-weight: 700; font-size: 1.65rem; letter-spacing: -0.03em; line-height: 1; } .brand-text--light { color: #fff; } .brand-text--dark { color: var(--ink); }
.brand-img { display: block; height: 30px; width: auto; max-width: 160px; }
.side .context { padding: 0 28px 18px; font-size: var(--t-meta); color: #a9a39d; }
.nav { display: flex; flex-direction: column; padding: 8px 12px; gap: 2px; flex: 1; overflow-y: auto; border-top: 1px solid #2c2a28; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: #cfcac4; text-decoration: none; border-radius: var(--r); position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: #242220; color: #fff; }
.nav a[aria-current="page"] { background: #2a2826; color: #fff; font-weight: 600; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--paper); }
.nav .sep { height: 1px; background: #2c2a28; margin: 10px 8px; }
.count { margin-left: auto; min-width: 20px; padding: 1px 6px; font-size: 0.75rem; font-weight: 600; text-align: center; background: var(--paper); color: var(--ink); border-radius: 2px; }
.count[hidden] { display: none; }
.side .me { padding: 16px 28px 0; border-top: 1px solid #2c2a28; display: flex; flex-direction: column; gap: 10px; }
.me strong { display: block; font-weight: 600; } .me span { color: #a9a39d; font-size: var(--t-meta); }
.me form button { background: none; border: 0; color: #cfcac4; padding: 0; cursor: pointer; font: inherit; display: inline-flex; gap: 8px; align-items: center; } .me form button:hover { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1140px; padding: 40px 48px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page-head h1 { font-size: var(--t-h1); } .page-head .sub { color: var(--ink-3); margin: 6px 0 0; font-size: var(--t-ui); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 48px; } section > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.section h2 { font-size: var(--t-h3); } .section header .muted { font-size: var(--t-meta); }
.muted { color: var(--ink-3); } .small { font-size: var(--t-meta); }
.crumbs { font-size: var(--t-meta); color: var(--ink-3); margin: 0 0 10px; } .crumbs a { color: var(--ink-3); text-decoration: none; } .crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 var(--t-ui)/1 var(--f); padding: 11px 18px; border-radius: var(--r); border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: #000; }
.btn--secondary { background: var(--white); color: var(--ink); border-color: var(--ink); } .btn--secondary:hover { background: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); border-color: transparent; padding-inline: 10px; } .btn--ghost:hover { background: var(--paper); }
.btn--danger { background: var(--white); color: var(--bad); border-color: var(--bad); } .btn--danger:hover { background: var(--bad); color: #fff; }
.btn--sm { padding: 7px 12px; font-size: var(--t-meta); } .btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* ---------- Formulários ---------- */
.field { margin-bottom: 20px; } .field label { display: block; font-weight: 600; font-size: var(--t-meta); margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid #bdb6ae; border-radius: var(--r); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.5; } input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25,25,25,.12); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--bad); }
.error { color: var(--bad); font-size: var(--t-meta); margin: 6px 0 0; } .hint { color: var(--ink-3); font-size: var(--t-meta); margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: var(--t-ui) !important; cursor: pointer; } .check input { margin-top: 4px; accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; } .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
.form-actions { display: flex; gap: 10px; padding-top: 12px; align-items: center; flex-wrap: wrap; }
.fieldset { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 12px; } .fieldset > h2 { font-size: var(--t-h3); margin-bottom: 4px; } .fieldset > .lede { color: var(--ink-3); margin: 0 0 20px; }
.pw { position: relative; } .pw input { padding-right: 46px; } .pw button { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 42px; background: none; border: 0; color: var(--ink-3); cursor: pointer; } .pw button:hover { color: var(--ink); }

/* ---------- Tabelas e listas ---------- */
.table { width: 100%; border-collapse: collapse; } .table th { text-align: left; font-weight: 500; font-size: var(--t-meta); color: var(--ink-3); padding: 0 16px 10px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.table td { padding: 15px 16px 15px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; } .table tr:hover td { background: #faf8f6; }
.table td:last-child, .table th:last-child { padding-right: 0; } .table .num { font-variant-numeric: tabular-nums; }
.table a.title { font-weight: 600; text-decoration: none; } .table a.title:hover { text-decoration: underline; }
.table .sub { color: var(--ink-3); font-size: var(--t-meta); display: block; }
.table-wrap { overflow-x: auto; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-meta); white-space: nowrap; } .status i { width: 8px; height: 8px; background: var(--ink-3); flex: none; }
.status--ok i { background: var(--ok); } .status--warn i { background: #c58b1a; } .status--bad i { background: var(--bad); } .status--active i { background: var(--ink); } .status--idle i { background: #b7b0a8; }
.unread-dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 8px; font-size: 0.7rem; font-weight: 700; background: var(--ink); color: #fff; text-align: center; border-radius: 2px; line-height: 18px; }
.list { list-style: none; margin: 0; padding: 0; } .list > li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; } .list > li:first-child { border-top: 1px solid var(--ink); }
.list .t { font-weight: 600; } .list .d { color: var(--ink-3); font-size: var(--t-meta); }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; } .meta dt { color: var(--ink-3); font-size: var(--t-meta); padding-top: 2px; } .meta dd { margin: 0; word-break: break-word; }
.panel { background: var(--paper); padding: 24px 28px; border-radius: var(--r); } .panel h2, .panel h3 { font-size: var(--t-h3); margin-bottom: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.stat { padding: 22px 0; min-width: 0; } .stat strong { display: block; font-size: 2.25rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; } .stat span { display: block; margin-top: 8px; color: var(--ink-3); font-size: var(--t-meta); }
.stat--hi strong { font-size: 3rem; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: flex-end; margin-top: 20px; font-size: var(--t-meta); } .pg { text-decoration: none; border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--r); } a.pg:hover { background: var(--paper); } .pg.is-off { color: var(--ink-3); border-color: var(--line-soft); } .pg-info { color: var(--ink-3); }
.filters { display: flex; gap: 12px; align-items: end; margin-bottom: 20px; flex-wrap: wrap; } .filters .field { margin: 0; min-width: 180px; } .filters .field.grow { flex: 1; min-width: 220px; }
.empty { border: 1px dashed #bdb6ae; padding: 40px 32px; text-align: left; border-radius: var(--r); } .empty h3 { font-size: var(--t-h3); margin-bottom: 6px; } .empty p { color: var(--ink-3); max-width: 52ch; margin-bottom: 16px; }
.empty > :last-child { margin-bottom: 0; }

/* ---------- Abas ---------- */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: -8px 0 32px; overflow-x: auto; }
.tabs a { padding: 12px 0; text-decoration: none; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; transition: color .15s; } .tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ---------- Avisos, diálogos ---------- */
.flash { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 13px 16px; margin-bottom: 24px; border-left: 3px solid var(--ink); background: var(--paper); } .flash p { margin: 0; }
.flash--success { border-color: var(--ok); } .flash--error { border-color: var(--bad); } .flash button { background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 0; }
.notice { padding: 14px 18px; background: var(--paper); border-left: 3px solid var(--warn); margin-bottom: 24px; } .notice p { margin: 0; } .notice--bad { border-color: var(--bad); }
dialog { border: 0; padding: 0; border-radius: 6px; width: min(480px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.18); } dialog::backdrop { background: rgba(25,25,25,.45); }
dialog .dlg { padding: 28px; } dialog h2 { font-size: var(--t-h3); margin-bottom: 10px; } dialog p { color: var(--ink-2); } dialog .form-actions { justify-content: flex-end; padding-top: 8px; } dialog.wide { width: min(620px, calc(100vw - 32px)); }

/* ---------- Autenticação ---------- */
.auth { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; }
.auth-brand { background: var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .lede { font-size: 1.75rem; line-height: 1.25; font-weight: 500; letter-spacing: -0.02em; max-width: 16ch; color: var(--paper); margin: 0; } .auth-brand small { color: #8d8781; }
.auth-form { display: flex; align-items: center; padding: 48px 64px; background: var(--white); } .auth-card { width: 100%; max-width: 400px; margin-inline: auto; }
.auth-card h1 { font-size: var(--t-h2); margin-bottom: 8px; } .auth-card .intro { color: var(--ink-3); margin-bottom: 28px; } .auth-card .brand-mobile { display: none; margin-bottom: 36px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 24px; font-size: var(--t-meta); }
.auth-card .flash { margin-bottom: 20px; }

/* ---------- Projetos (portal) ---------- */
.proj-list { border-top: 1px solid var(--ink); } .proj { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .15s; }
a.proj:hover { background: #faf8f6; } .proj h3 { font-size: var(--t-h2); margin-bottom: 6px; } .proj p { color: var(--ink-2); margin: 0 0 10px; max-width: 70ch; } .proj .side-meta { font-size: var(--t-meta); color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.proj .cat { color: var(--ink-3); font-size: var(--t-meta); }
.group { margin-top: 36px; } .group:first-child { margin-top: 0; } .group > h3 { font-size: var(--t-h3); } .group > p { color: var(--ink-3); margin: 4px 0 0; }
.group > .list { margin-top: 14px; }
.file-ico { color: var(--ink-3); flex: none; margin-top: 2px; } .li-main { display: flex; gap: 14px; min-width: 0; } .li-main > div { min-width: 0; } .li-main .t { word-break: break-word; }
.banner { background: var(--ink); color: #fff; padding: 10px 48px; font-size: var(--t-meta); display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; } .banner a { color: #fff; }

/* ---------- Leitura de documentos ---------- */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc-index { position: sticky; top: 24px; } .doc-index a { display: block; padding: 8px 0 8px 14px; border-left: 2px solid var(--line-soft); color: var(--ink-3); text-decoration: none; } .doc-index a:hover { color: var(--ink); } .doc-index a[aria-current="page"] { border-left-color: var(--ink); color: var(--ink); font-weight: 600; }
.doc-title { font-size: 2rem; margin-bottom: 8px; } .doc-meta { color: var(--ink-3); font-size: var(--t-meta); margin-bottom: 32px; }
.prose { font-size: var(--t-read); line-height: 1.7; max-width: 70ch; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 .6em; } .prose h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; } .prose h4 { font-size: 1.05rem; margin: 1.6em 0 .4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; } .prose ul, .prose ol { padding-left: 1.5em; } .prose li { margin-bottom: .3em; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--ink); color: var(--ink-2); } .prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose a { text-decoration: underline; } .prose img { max-width: 100%; height: auto; display: block; margin: 1.4em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: var(--t-ui); display: block; overflow-x: auto; } .prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; } .prose th { background: var(--paper); }
.ta-left { text-align: left; } .ta-center { text-align: center; } .ta-right { text-align: right; } .ta-justify { text-align: justify; }

/* ---------- Editor ---------- */
.editor-wrap { background: var(--paper); margin: 0 -48px; padding: 0 48px 80px; }
.ed-bar { position: sticky; top: 0; z-index: 5; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; margin: 0 auto; max-width: 860px; transform: translateY(-14px); }
.ed-bar button, .ed-bar select { font: 500 var(--t-meta) var(--f); min-width: 34px; height: 32px; padding: 0 9px; border: 0; background: transparent; color: var(--ink); border-radius: var(--r); cursor: pointer; } .ed-bar select { border: 1px solid var(--line); width: auto; padding-inline: 6px; }
.ed-bar button:hover { background: var(--paper); } .ed-bar button.on { background: var(--ink); color: #fff; } .ed-bar .gap { width: 1px; background: var(--line); margin: 4px 6px; }
.ed-page { background: var(--white); max-width: 860px; margin: 8px auto 0; padding: 56px 72px 72px; min-height: 60vh; border: 1px solid var(--line); border-radius: var(--r); }
input.ed-title, input.ed-summary { border: 0; padding: 0; box-shadow: none; background: transparent; border-radius: 0; }
input.ed-title { font: 600 2rem/1.2 var(--f); letter-spacing: -0.02em; margin-bottom: 8px; }
input.ed-summary { color: var(--ink-3); margin-bottom: 28px; font-size: var(--t-ui); }
input.ed-title:focus, input.ed-summary:focus { box-shadow: none; outline: none; }
input.ed-title::placeholder, input.ed-summary::placeholder { color: #aaa49d; }
.ed-body { outline: none; min-height: 40vh; } .ed-body:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.ed-status { display: flex; gap: 12px; align-items: center; font-size: var(--t-meta); color: var(--ink-3); } .ed-status i { width: 8px; height: 8px; background: var(--ok); } .ed-status[data-state="saving"] i, .ed-status[data-state="dirty"] i { background: #c58b1a; } .ed-status[data-state="error"] i { background: var(--bad); }
.ed-top { max-width: 860px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 28px 0 20px; flex-wrap: wrap; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); height: min(68vh, 640px); min-height: 420px; background: var(--white); }
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; background: #fbfaf8; }
.msg { max-width: min(560px, 82%); display: flex; flex-direction: column; gap: 4px; } .msg.mine { align-self: flex-end; align-items: flex-end; }
.msg .bubble { padding: 10px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 2px 10px 10px 10px; white-space: pre-wrap; overflow-wrap: anywhere; } .msg.mine .bubble { background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 10px 2px 10px 10px; }
.msg .info { font-size: 0.75rem; color: var(--ink-3); } .msg .att { display: inline-flex; gap: 8px; align-items: center; margin-top: 6px; font-size: var(--t-meta); color: inherit; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-3); max-width: 34ch; }
.chat-form { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 10px; align-items: flex-end; } .chat-form textarea { resize: none; min-height: 44px; max-height: 140px; }
.chat-form .att-name { font-size: var(--t-meta); color: var(--ink-3); padding: 0 12px 6px; display: flex; gap: 8px; align-items: center; }
.chat-err { color: var(--bad); font-size: var(--t-meta); padding: 0 14px 10px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid #bdb6ae; background: var(--white); border-radius: var(--r); cursor: pointer; color: var(--ink); flex: none; } .icon-btn:hover { background: var(--paper); }

/* ---------- Materiais (admin) ---------- */
.group-admin { margin-top: 40px; } .group-admin > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; } .group-admin h3 { font-size: var(--t-h3); }
.vis { font-size: var(--t-meta); color: var(--ink-3); } .vis--on { color: var(--ok); }
.dropzone { border: 1px dashed #9d968e; padding: 22px; border-radius: var(--r); background: var(--white); } .dropzone.is-over { background: var(--paper); border-color: var(--ink); }
.cf-row { display: grid; grid-template-columns: 1fr 2fr auto auto; gap: 10px; align-items: start; margin-bottom: 10px; } .cf-row .check { margin-top: 8px; white-space: nowrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; gap: 32px; } .doc-layout { grid-template-columns: 1fr; gap: 24px; } .doc-index { position: static; display: flex; gap: 6px; overflow-x: auto; } .doc-index a { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; white-space: nowrap; } .doc-index a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; } body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 20; } .topbar button { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
  .content { padding: 28px 20px 72px; } .banner { padding-inline: 20px; } .editor-wrap { margin: 0 -20px; padding: 0 12px 60px; } .ed-page { padding: 32px 22px 48px; }
  .auth { grid-template-columns: 1fr; } .auth-brand { display: none; } .auth-form { padding: 32px 22px; align-items: flex-start; } .auth-card .brand-mobile { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; } .proj { grid-template-columns: 1fr; gap: 12px; } .page-head h1 { font-size: 1.5rem; } .cf-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; } .meta { grid-template-columns: 1fr; gap: 2px; } .meta dd { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .topbar, .tabs, .banner { display: none; } .shell { display: block; } }
.topbar-spacer { width: 34px; }
.sec-title { font-size: var(--t-h3); margin-bottom: 16px; } code { font: 0.875em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper); padding: 1px 5px; border-radius: 2px; }
.narrow { max-width: 720px; } .narrow-s { max-width: 560px; } .narrow-l { max-width: 760px; } .measure { max-width: 60ch; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-28 { margin-bottom: 28px; } .pre { white-space: pre-wrap; }
.mt-40 { margin-top: 40px; }

/* ========================================================================== 
   KOSM PORTAL — Premium interface layer
   Mantém os componentes e contratos existentes; eleva composição e acabamento.
   ========================================================================== */
:root {
  --ink: #191919;
  --paper: #f1ede9;
  --white: #fff;
  --ink-2: #514c47;
  --ink-3: #817a73;
  --line: #ded8d1;
  --line-soft: #eee9e3;
  --ok: #286342;
  --warn: #8a5a18;
  --bad: #a33e37;
  --active: #191919;
  --side-w: 270px;
  --r: 8px;
  --shadow-soft: 0 2px 10px rgba(25, 25, 25, .035), 0 14px 34px rgba(25, 25, 25, .035);
  --shadow-card: 0 1px 2px rgba(25, 25, 25, .04), 0 8px 24px rgba(25, 25, 25, .045);
  --shadow-raised: 0 16px 44px rgba(25, 25, 25, .13);
  --t-h1: clamp(1.85rem, 2.3vw, 2.35rem);
}

html { scroll-behavior: smooth; }
body {
  background: #f5f3f0;
  color: var(--ink);
  letter-spacing: -.006em;
}
::selection { color: #fff; background: #4c4945; }
:focus-visible { outline: 2px solid #6f675f; outline-offset: 3px; }

/* Estrutura e navegação */
.shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side {
  background: #191919;
  color: #fff;
  padding: 30px 0 22px;
  border-right: 1px solid #302e2b;
  box-shadow: 8px 0 30px rgba(25, 25, 25, .035);
}
.side .brand {
  position: relative;
  padding: 0 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side .brand::after {
  content: "CLIENT SPACE";
  color: #8c8781;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .2em;
}
.brand-text {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: 1;
}
.brand-img { height: 34px; max-width: 172px; object-fit: contain; object-position: left center; }
.side .context {
  padding: 0 30px 18px;
  color: #9d9790;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav {
  padding: 18px 14px 16px;
  gap: 5px;
  border-top: 1px solid #302e2b;
  scrollbar-width: thin;
  scrollbar-color: #514c47 transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb {
  background: #514c47;
  border: 1px solid #191919;
  border-radius: 999px;
}
.nav::-webkit-scrollbar-thumb:hover { background: #756d64; }
.nav::-webkit-scrollbar-corner { background: transparent; }
.nav a {
  min-height: 44px;
  gap: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #c9c4be;
  font-size: .9rem;
  font-weight: 450;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav a svg { width: 18px; height: 18px; color: #aaa39c; transition: color .18s ease; }
.nav a:hover { color: #fff; background: #252321; }
.nav a:hover svg { color: #fff; }
.nav a[aria-current="page"] {
  color: #fff;
  background: #302e2b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .045);
  font-weight: 600;
}
.nav a[aria-current="page"] svg { color: #f1ede9; }
.nav a[aria-current="page"]::before {
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 2px;
  background: #e9e1d8;
}
.nav .sep { background: #35312e; margin: 12px 8px; }
.count {
  min-width: 21px;
  padding: 2px 7px;
  color: #191919;
  background: #f1ede9;
  border-radius: 20px;
  font-size: 10px;
  line-height: 1.5;
}
.side .me {
  gap: 12px;
  padding: 18px 26px 0;
  border-top-color: #302e2b;
}
.me strong { font-size: .9rem; font-weight: 600; }
.me span { display: block; max-width: 100%; overflow-wrap: anywhere; color: #928c85; font-size: .75rem; }
.me form button { color: #c5beb7; font-size: .82rem; transition: color .15s ease; }
.me form button:hover { color: #fff; }
.main { min-width: 0; }
.content {
  width: 100%;
  max-width: 1520px;
  padding: 44px clamp(28px, 4vw, 68px) 104px;
}
.topbar { background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
.topbar .brand-text { font-size: 1.55rem; }
.topbar::after {
  content: "CLIENT SPACE";
  margin-right: auto;
  color: #817a73;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .16em;
}
.topbar-spacer { display: none; }
.page-head {
  align-items: center;
  gap: 22px;
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom-color: #ded9d2;
}
.page-head h1 {
  font-size: var(--t-h1);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.08;
}
.page-head .sub {
  color: #77716b;
  margin-top: 9px;
  font-size: .94rem;
  line-height: 1.55;
}
.page-head .actions { gap: 9px; }
.crumbs {
  margin-bottom: 11px;
  color: #8b837b;
  font-size: .75rem;
  letter-spacing: .015em;
}
.crumbs a { color: #706960; text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.section { margin-top: 36px; }
section > header { align-items: center; margin-bottom: 16px; }
.section h2, .sec-title { font-size: 1.08rem; font-weight: 650; letter-spacing: -.025em; }
section > header a { color: #716960; font-size: .8rem; font-weight: 550; text-decoration: none; }
section > header a:hover { color: var(--ink); text-decoration: underline; }
.muted { color: #79736d; }
.small { font-size: .78rem; }

/* Botões e interações */
.btn {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #191919;
  border-radius: 7px;
  background: #191919;
  color: #fff;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: -.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn:hover { background: #353331; border-color: #353331; box-shadow: 0 4px 12px rgba(25, 25, 25, .12); }
.btn--secondary { background: #fff; color: #242321; border-color: #d7d1ca; box-shadow: none; }
.btn--secondary:hover { background: #f5f2ee; border-color: #aaa198; color: #191919; }
.btn--ghost { background: transparent; color: #5c5650; border-color: transparent; box-shadow: none; }
.btn--ghost:hover { background: #efebe6; color: #191919; border-color: #e5dfd8; box-shadow: none; }
.btn--danger { color: #9b3933; background: #fff; border-color: #e3c5c2; box-shadow: none; }
.btn--danger:hover { color: #fff; background: #9b3933; border-color: #9b3933; }
.btn--sm { min-height: 33px; padding: 0 11px; font-size: .75rem; border-radius: 6px; }
.btn--block { min-height: 46px; }
.btn svg { flex: none; }
.inline-form { display: inline-flex; }
.row-actions { gap: 5px; }
.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid #ded8d1;
  border-radius: 8px;
  background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: #f4f1ed; border-color: #bdb5ac; }

/* Formulários */
.field { margin-bottom: 19px; }
.field label {
  margin-bottom: 8px;
  color: #393633;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .005em;
}
.opt { color: #928a81; font-size: .72rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input[type=search], input[type=number], select, textarea {
  min-height: 44px;
  padding: 10px 13px;
  color: #242321;
  background: #fff;
  border: 1px solid #d9d3cc;
  border-radius: 7px;
  font-size: .88rem;
  box-shadow: 0 1px 1px rgba(25, 25, 25, .018);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 100px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #aaa39b; }
input:hover, select:hover, textarea:hover { border-color: #b7afa6; }
input:focus, select:focus, textarea:focus {
  border-color: #777067;
  outline: none;
  box-shadow: 0 0 0 3px rgba(25, 25, 25, .075);
}
input[type=checkbox] { accent-color: #191919; }
.check { gap: 11px; color: #4f4943; }
.check input { width: 16px; height: 16px; accent-color: #191919; }
.hint, .error { font-size: .75rem; line-height: 1.55; }
.hint { color: #817970; }
.fieldset { border-top-color: #e3ded8; padding-top: 24px; margin-top: 25px; }
.fieldset > h2 { font-size: 1rem; letter-spacing: -.025em; }
.fieldset > .lede { color: #79726b; font-size: .86rem; }
.form-actions { gap: 9px; }
form.narrow, form.narrow-s, form.narrow-l {
  padding: 30px;
  border: 1px solid #e7e2dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
form.narrow { max-width: 760px; }
form.narrow-s { max-width: 620px; }
form.narrow-l { max-width: 980px; }
.project-form .panel { position: sticky; top: 24px; }
.project-form .panel .meta { margin-top: 20px; }
.cf-row { padding: 12px; border: 1px solid #ebe6e0; border-radius: 8px; background: #faf9f7; grid-template-columns: minmax(110px, .85fr) minmax(160px, 1.45fr) auto auto; }
.cf-row .check { align-items: center; margin-top: 9px; font-size: .77rem !important; }

/* Superfícies, tabelas e listas */
.panel {
  padding: 25px;
  background: #fff;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  box-shadow: var(--shadow-soft);
}
.panel h2, .panel h3 { margin-bottom: 17px; font-size: 1.02rem; font-weight: 650; letter-spacing: -.025em; }
.split { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 30px; }
.meta { grid-template-columns: minmax(88px, max-content) minmax(0, 1fr); gap: 12px 20px; }
.meta dt { color: #817970; font-size: .75rem; }
.meta dd { color: #302d29; font-size: .86rem; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.table { border-collapse: separate; border-spacing: 0; }
.table th {
  padding: 15px 17px;
  color: #817970;
  background: #f8f6f3;
  border-bottom: 1px solid #e9e4de;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.table td {
  padding: 17px;
  color: #48423d;
  border-bottom: 1px solid #f0ece7;
  font-size: .84rem;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #faf9f7; }
.table a.title { color: #252321; font-weight: 650; }
.table a.title:hover { color: #71665b; }
.table .sub { margin-top: 4px; color: #898178; font-size: .74rem; line-height: 1.45; }
.table td.num { font-variant-numeric: tabular-nums; color: #4e4943; }
.status {
  min-height: 25px;
  padding: 4px 9px;
  gap: 7px;
  border-radius: 30px;
  background: #f1efec;
  color: #5f5952;
  font-size: .72rem;
  font-weight: 600;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--ok { color: #286342; background: #edf5ef; }
.status--warn { color: #865615; background: #fbf3e7; }
.status--bad { color: #9d4039; background: #faefee; }
.status--active { color: #282725; background: #eeece9; }
.status--idle { color: #77716b; background: #f2f0ed; }
.unread-dot {
  min-width: 19px;
  padding: 0 6px;
  border-radius: 20px;
  background: #191919;
  line-height: 19px;
  font-size: .66rem;
}
.list { display: flex; flex-direction: column; gap: 0; }
.list > li {
  padding: 17px 2px;
  border-bottom: 1px solid #eee9e3;
  align-items: center;
  gap: 18px;
}
.list > li:first-child { border-top: 1px solid #e8e2dc; }
.list > li:last-child { border-bottom: 0; }
.list .t { color: #282623; font-size: .87rem; font-weight: 650; text-decoration: none; }
.list .t:hover { color: #74695d; }
.list .d { margin-top: 4px; color: #898178; font-size: .74rem; line-height: 1.5; }
.li-main { gap: 13px; }
.file-ico {
  width: 38px;
  height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  border: 1px solid #e7e1d9;
  border-radius: 8px;
  background: #f6f3ef;
  color: #4e4943;
}
.file-ico svg { width: 17px; height: 17px; }
.pager { gap: 9px; color: #77716b; }
.pg { padding: 8px 13px; border: 1px solid #e0dad3; border-radius: 7px; background: #fff; text-decoration: none; }
a.pg:hover { background: #f1ede9; border-color: #cfc7bd; }
.pg.is-off { background: #f7f5f2; }
.filters {
  align-items: end;
  padding: 17px 18px 1px;
  margin-bottom: 20px;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(25, 25, 25, .025);
}
.filters .field { min-width: 190px; }
.filters .field.grow { min-width: 260px; }
.filters > .btn { margin-bottom: 18px; }
.empty {
  padding: 34px 32px;
  border: 1px dashed #d4cdc5;
  border-radius: 11px;
  background: rgba(255, 255, 255, .66);
  text-align: left;
}
.empty h3 { margin-bottom: 7px; color: #302d29; font-size: 1rem; font-weight: 650; }
.empty p { max-width: 58ch; margin-bottom: 16px; color: #817970; font-size: .85rem; }
.empty > :last-child { margin-bottom: 0; }

/* Dashboard da equipe */
.dashboard-page .page-head,
.portal-home-page .page-head {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 31px 36px;
  margin: 0 0 23px;
  border: 1px solid #292725;
  border-radius: 13px;
  background: #191919;
  color: #fff;
  box-shadow: 0 12px 30px rgba(25, 25, 25, .09);
}
.dashboard-page .page-head::before,
.portal-home-page .page-head::before {
  content: "";
  position: absolute;
  top: -122px;
  right: 8%;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(241, 237, 233, .11);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(241, 237, 233, .025), 0 0 0 58px rgba(241, 237, 233, .02), 0 0 0 92px rgba(241, 237, 233, .015);
  pointer-events: none;
}
.dashboard-page .page-head::after,
.portal-home-page .page-head::after {
  content: "K";
  position: absolute;
  top: 29px;
  right: 35px;
  color: rgba(241, 237, 233, .055);
  font-size: 10rem;
  font-weight: 700;
  letter-spacing: -.12em;
  line-height: 1;
  pointer-events: none;
}
.dashboard-page .page-head > div,
.portal-home-page .page-head > div { position: relative; z-index: 1; }
.dashboard-page .eyebrow,
.portal-home-page .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
  color: #b4aca3;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.eyebrow-mark { width: 6px; height: 6px; border-radius: 50%; background: #d8d0c7; box-shadow: 0 0 0 4px rgba(216, 208, 199, .1); }
.dashboard-page .page-head h1,
.portal-home-page .page-head h1 { color: #fff; font-size: clamp(2rem, 3vw, 2.55rem); letter-spacing: -.065em; }
.dashboard-page .page-head .sub,
.portal-home-page .page-head .sub { color: #aaa39b; font-size: .9rem; }
.dashboard-page .page-head .actions,
.portal-home-page .page-head .actions { position: relative; z-index: 1; }
.dashboard-page .page-head .btn,
.portal-home-page .page-head .btn { min-height: 43px; background: #f1ede9; color: #191919; border-color: #f1ede9; }
.dashboard-page .page-head .btn:hover,
.portal-home-page .page-head .btn:hover { background: #fff; border-color: #fff; }
.dashboard-page .page-head .btn--secondary,
.portal-home-page .page-head .btn--secondary { color: #f1ede9; background: transparent; border-color: #55514c; }
.dashboard-page .page-head .btn--secondary:hover,
.portal-home-page .page-head .btn--secondary:hover { background: #292725; border-color: #8a8279; }
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  border: 0;
}
.stat {
  position: relative;
  min-height: 122px;
  padding: 22px 23px;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.stat strong {
  color: #22201e;
  font-size: 2.15rem;
  font-weight: 650;
  letter-spacing: -.065em;
  line-height: 1.05;
}
.stat span {
  margin-top: 10px;
  color: #817970;
  font-size: .74rem;
  font-weight: 550;
  line-height: 1.4;
}
.stat--hi {
  border-color: #191919;
  background: #242321;
}
.stat--hi strong { color: #fff; font-size: 2.4rem; }
.stat--hi span { color: #c2bbb3; }
.dashboard-page .split { margin-top: 28px; }
.dashboard-page .split > div > section,
.dashboard-page .split > section {
  padding: 23px 25px;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.dashboard-page .split > div > section + section { margin-top: 18px; }
.dashboard-page .split .section { margin-top: 18px; }
.dashboard-page .split section > header { margin-bottom: 15px; }
.dashboard-page .split .empty { border-color: #e5dfd8; background: #faf9f7; }

/* Navegação de projetos e portal do cliente */
.tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  margin: -8px 0 27px;
  overflow-x: auto;
  border: 1px solid #e6e0d9;
  border-radius: 9px;
  background: #eeebe7;
}
.tabs a {
  padding: 9px 14px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  color: #706961;
  font-size: .8rem;
  font-weight: 550;
}
.tabs a:hover { color: #191919; background: rgba(255, 255, 255, .6); }
.tabs a[aria-current="page"] {
  color: #fff;
  background: #191919;
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.tabs a .muted { color: inherit; opacity: .65; }
.proj-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 0;
}
.proj {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 190px;
  gap: 24px;
  padding: 23px 24px;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
a.proj:hover {
  background: #fff;
  border-color: #c9c1b7;
  box-shadow: 0 10px 28px rgba(25, 25, 25, .075);
}
.proj h3 { margin-bottom: 8px; font-size: 1.14rem; font-weight: 650; letter-spacing: -.035em; }
.proj p { margin-bottom: 11px; color: #6d665e; font-size: .83rem; line-height: 1.6; }
.proj .cat { color: #8c837a; font-size: .7rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.proj .side-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 14px;
  padding-top: 15px;
  border-top: 1px solid #eee9e3;
  color: #817970;
  font-size: .72rem;
}
.proj .side-meta .status { order: -1; }
.portal-home-page .split { margin-top: 26px; }
.portal-home-page .split > section,
.portal-home-page .split > aside {
  padding: 24px;
  border: 1px solid #e7e2dc;
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.portal-home-page .split .proj-list { grid-template-columns: 1fr; }
.portal-home-page .split .proj { min-height: 160px; }
.portal-home-page .sec-title { margin-bottom: 15px; }
.portal-home-page .notice { margin: 0 0 20px; border-radius: 9px; }
.group { margin-top: 30px; }
.group > h3 { font-size: 1rem; font-weight: 650; }
.group > p { color: #817970; font-size: .8rem; }
.group > .list { margin-top: 13px; }
.banner { padding: 12px clamp(20px, 4vw, 68px); background: #242321; font-size: .78rem; }
.banner a { color: #fff; font-weight: 600; }

/* Documentação e editor */
.doc-layout { grid-template-columns: 245px minmax(0, 1fr); gap: 34px; }
.doc-index {
  padding: 15px;
  border: 1px solid #e7e2dc;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.doc-index a {
  padding: 10px 12px;
  margin: 2px 0;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 5px;
  color: #716a62;
  font-size: .81rem;
  line-height: 1.45;
}
.doc-index a:hover { color: #191919; background: #f7f5f2; }
.doc-index a[aria-current="page"] {
  color: #191919;
  border-left-color: #191919;
  background: #f3f0ec;
  font-weight: 650;
}
.doc-title { font-size: clamp(1.7rem, 2.5vw, 2.25rem); font-weight: 650; letter-spacing: -.055em; }
.doc-meta { color: #877f76; font-size: .76rem; }
.prose { color: #393530; font-size: 1rem; line-height: 1.78; }
.prose h2 { margin-top: 1.8em; font-size: 1.42rem; letter-spacing: -.035em; }
.prose h3 { font-size: 1.12rem; letter-spacing: -.025em; }
.prose blockquote { padding: 15px 18px; border-left: 3px solid #191919; border-radius: 0 7px 7px 0; background: #f5f2ee; }
.prose th { background: #f3f0ec; }
.editor-wrap {
  margin: 0 calc(clamp(28px, 4vw, 68px) * -1);
  padding: 0 clamp(24px, 4vw, 68px) 80px;
  background: #eeebe7;
  border-top: 1px solid #e5dfd8;
}
.ed-top { max-width: 940px; padding: 27px 0 20px; }
.ed-status { gap: 9px; font-size: .76rem; font-weight: 550; }
.ed-status i { width: 7px; height: 7px; border-radius: 50%; }
.ed-bar {
  max-width: 940px;
  padding: 7px;
  gap: 3px;
  border: 1px solid #e2dcd5;
  border-radius: 9px;
  box-shadow: 0 6px 18px rgba(25, 25, 25, .06);
  transform: translateY(-7px);
}
.ed-bar button, .ed-bar select { min-width: 36px; height: 34px; border-radius: 5px; font-size: .75rem; }
.ed-bar button:hover { background: #f0ede9; }
.ed-bar button.on { background: #191919; color: #fff; }
.ed-bar .gap { background: #e3ded8; margin-inline: 5px; }
.ed-page {
  max-width: 940px;
  min-height: 68vh;
  margin-top: 9px;
  padding: 62px clamp(30px, 6vw, 82px) 82px;
  border: 1px solid #e8e3dd;
  border-radius: 5px;
  box-shadow: 0 12px 35px rgba(25, 25, 25, .055);
}
input.ed-title { font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 650; letter-spacing: -.06em; }
input.ed-summary { color: #837b72; font-size: .9rem; }
.ed-body { min-height: 48vh; color: #393530; }

/* Comunicação */
.chat {
  height: min(72vh, 720px);
  min-height: 480px;
  overflow: hidden;
  border: 1px solid #e5dfd8;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.chat-log { padding: 28px; gap: 17px; background: #f7f5f2; }
.msg { max-width: min(600px, 82%); gap: 6px; }
.msg .bubble {
  padding: 12px 16px;
  border: 1px solid #e4ded7;
  border-radius: 4px 12px 12px 12px;
  background: #fff;
  color: #302d29;
  font-size: .88rem;
  line-height: 1.6;
  box-shadow: 0 2px 7px rgba(25, 25, 25, .025);
}
.msg.mine .bubble { border-color: #252321; border-radius: 12px 4px 12px 12px; background: #252321; color: #fff; }
.msg .info { color: #8c8379; font-size: .68rem; }
.chat-empty { max-width: 38ch; color: #817970; }
.chat-empty strong { display: block; margin-bottom: 5px; color: #393530; font-size: .95rem; }
.chat-form { padding: 16px; border-top-color: #e7e1da; background: #fff; }
.chat-form textarea { min-height: 46px; max-height: 150px; background: #faf9f7; }
.chat-form .btn { min-height: 46px; }
.chat-err { padding: 0 18px 12px; }

/* Materiais, arquivos e configurações */
.group-admin { margin-top: 30px; padding: 21px 23px 12px; border: 1px solid #e7e2dc; border-radius: 11px; background: #fff; box-shadow: var(--shadow-soft); }
.group-admin:first-child { margin-top: 0; }
.group-admin > header { align-items: center; margin-bottom: 10px; }
.group-admin h3 { font-size: 1rem; font-weight: 650; }
.vis { padding: 4px 8px; border-radius: 20px; background: #f1efec; color: #716a62; font-size: .68rem; font-weight: 650; }
.vis--on { background: #edf5ef; color: #286342; }
.dropzone { padding: 18px; border: 1px dashed #c9c1b8; border-radius: 8px; background: #faf9f7; }
.dropzone.is-over { border-color: #191919; background: #f1ede9; }
.group-admin + .group-admin { margin-top: 16px; }
.notice {
  padding: 15px 18px;
  border: 1px solid #e9d8bd;
  border-left: 3px solid #a57837;
  border-radius: 8px;
  background: #fbf6ed;
  color: #65533a;
  font-size: .84rem;
}
.notice--bad { border-color: #e5cecb; border-left-color: #a33e37; background: #faf0ef; color: #843b35; }
.flash {
  padding: 14px 17px;
  margin-bottom: 20px;
  border: 1px solid #e4ded7;
  border-left: 3px solid #191919;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 25, 25, .035);
  font-size: .84rem;
}
.flash--success { border-left-color: #39744e; }
.flash--error { border-left-color: #a33e37; }
.flash button { padding: 2px; }

/* Diálogos */
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 1px solid #e5dfd8;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-raised);
}
dialog::backdrop { background: rgba(20, 19, 18, .52); backdrop-filter: blur(3px); }
dialog .dlg { padding: 29px; }
dialog h2 { margin-bottom: 13px; font-size: 1.15rem; font-weight: 650; letter-spacing: -.03em; }
dialog p { color: #716a62; font-size: .87rem; line-height: 1.6; }
dialog .form-actions { justify-content: flex-end; }
dialog.wide { width: min(680px, calc(100vw - 32px)); }

/* Autenticação */
.auth { grid-template-columns: minmax(340px, 5fr) 7fr; background: #f5f3f0; }
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 54px clamp(38px, 5vw, 76px);
  background: #191919;
}
.auth-brand::before {
  content: "";
  position: absolute;
  right: -140px;
  bottom: 9%;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(241, 237, 233, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(241, 237, 233, .025), 0 0 0 75px rgba(241, 237, 233, .02), 0 0 0 120px rgba(241, 237, 233, .015);
}
.auth-brand::after {
  content: "K";
  position: absolute;
  right: 50px;
  bottom: 12%;
  color: rgba(241, 237, 233, .055);
  font-size: 19rem;
  font-weight: 700;
  letter-spacing: -.15em;
  line-height: .8;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand-text { font-size: 2.2rem; }
.auth-brand .brand-img { height: 38px; }
.auth-brand .lede {
  max-width: 12ch;
  color: #f1ede9;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 500;
  letter-spacing: -.065em;
  line-height: 1.08;
}
.auth-brand small { color: #928a82; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.auth-form { justify-content: center; padding: 56px clamp(28px, 6vw, 90px); background: #f5f3f0; }
.auth-card {
  max-width: 440px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid #e7e2dc;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(25, 25, 25, .055);
}
.auth-card h1 { font-size: 1.8rem; font-weight: 650; letter-spacing: -.055em; }
.auth-card .intro { color: #817970; font-size: .88rem; line-height: 1.6; margin-bottom: 28px; }
.auth-links { color: #756d65; font-size: .76rem; }
.auth-links a { color: #302d29; font-weight: 600; }
.auth-card .brand-mobile { display: none; }

/* Prévia, atividades e pequenos detalhes */
.sec-title { font-size: 1rem; font-weight: 650; }
code { color: #49433d; background: #f0ede9; border: 1px solid #e7e1da; border-radius: 4px; padding: 2px 5px; }
.ed-body a, .prose a { color: #3a3733; text-decoration-thickness: 1px; }
.ed-body table, .prose table { border-color: #e5dfd8; }
.ed-body th, .prose th { background: #f4f1ed; }

/* Responsividade */
@media (max-width: 1180px) {
  .content { padding-inline: 34px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proj-list { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .project-form .panel { position: static; }
  .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  .doc-index { position: static; display: flex; gap: 5px; overflow-x: auto; padding: 8px; }
  .doc-index a { flex: none; padding: 9px 12px; border: 0; border-radius: 6px; }
  .doc-index a[aria-current="page"] { color: #fff; background: #191919; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(310px, 88vw);
    padding-top: 26px;
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2, .7, .2, 1);
  }
  body.nav-open .side { transform: translateX(0); }
  body.nav-open::after { background: rgba(16, 15, 14, .55); backdrop-filter: blur(2px); }
  .topbar {
    display: flex;
    min-height: 64px;
    padding: 10px 19px;
    gap: 14px;
    border-bottom: 1px solid #e7e2dc;
  }
  .topbar button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; }
  .topbar button:hover { background: #f1ede9; }
  .content { max-width: none; padding: 29px 24px 72px; }
  .banner { padding-inline: 24px; }
  .editor-wrap { margin: 0 -24px; padding: 0 16px 58px; }
  .ed-page { padding: 42px 30px 58px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form { min-height: 100vh; padding: 28px 20px; align-items: center; }
  .auth-card { padding: 34px 28px; }
  .auth-card .brand-mobile { display: block; margin-bottom: 34px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .proj { min-height: 0; }
  .page-head { align-items: flex-start; }
  .dashboard-page .page-head,
  .portal-home-page .page-head { min-height: 180px; padding: 27px 27px; }
  .dashboard-page .split > div > section,
  .dashboard-page .split > section { padding: 20px; }
}
@media (max-width: 620px) {
  .content { padding: 23px 16px 60px; }
  .page-head { gap: 16px; padding-bottom: 21px; margin-bottom: 22px; }
  .page-head h1 { font-size: 1.75rem; }
  .page-head .sub { font-size: .84rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .dashboard-page .page-head,
  .portal-home-page .page-head { padding: 24px 21px; border-radius: 11px; }
  .dashboard-page .page-head::before,
  .portal-home-page .page-head::before { right: -30%; opacity: .75; }
  .dashboard-page .page-head::after,
  .portal-home-page .page-head::after { right: 14px; top: 35px; font-size: 7rem; }
  .dashboard-page .page-head .actions,
  .portal-home-page .page-head .actions { width: auto; margin-top: 8px; }
  .dashboard-page .page-head .actions .btn,
  .portal-home-page .page-head .actions .btn { flex: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { min-height: 108px; padding: 17px 16px; }
  .stat strong { font-size: 1.8rem; }
  .stat--hi strong { font-size: 2rem; }
  .stat span { font-size: .69rem; }
  .dashboard-page .split > div > section,
  .dashboard-page .split > section,
  .portal-home-page .split > section,
  .portal-home-page .split > aside { padding: 18px; }
  .filters { display: grid; grid-template-columns: 1fr; gap: 0; padding: 15px 15px 0; }
  .filters .field, .filters .field.grow { min-width: 0; }
  .filters > .btn { margin: 0 0 15px; width: 100%; }
  .table-wrap { margin-inline: -2px; }
  .table { min-width: 650px; }
  .table th, .table td { padding: 13px 14px; }
  .proj { padding: 19px; }
  .proj h3 { font-size: 1.03rem; }
  .proj .side-meta { align-items: flex-start; justify-content: flex-start; }
  .tabs { display: flex; width: 100%; margin-bottom: 22px; }
  .tabs a { padding-inline: 12px; }
  .list > li { align-items: flex-start; gap: 10px; }
  .list > li > .d { flex: none; font-size: .66rem; }
  form.narrow, form.narrow-s, form.narrow-l { padding: 21px 18px; }
  .panel { padding: 20px; }
  .group-admin { padding: 18px 16px 8px; }
  .cf-row { grid-template-columns: 1fr; }
  .cf-row .check { margin: 0; }
  .row-actions { justify-content: flex-start; }
  .chat { min-height: 450px; height: 68vh; }
  .chat-log { padding: 17px 13px; }
  .msg { max-width: 91%; }
  .chat-form { padding: 10px; gap: 7px; }
  .chat-form .btn { min-width: 44px; padding-inline: 11px; font-size: 0; }
  .chat-form .btn svg { width: 18px; height: 18px; }
  .icon-btn { width: 42px; height: 44px; }
  .editor-wrap { margin: 0 -16px; padding: 0 9px 48px; }
  .ed-top { align-items: flex-start; padding: 22px 8px 17px; }
  .ed-top .row-actions { width: 100%; }
  .ed-bar { border-radius: 7px; }
  .ed-page { padding: 32px 20px 44px; }
  .ed-bar button, .ed-bar select { min-width: 32px; }
  .doc-index { margin-inline: -2px; }
  .auth-card { padding: 29px 22px; }
  .auth-links { align-items: flex-start; gap: 12px; flex-direction: column; }
  .meta { grid-template-columns: 1fr; gap: 2px; }
  .meta dd { margin-bottom: 10px; }
  dialog .dlg { padding: 23px 19px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
