/* DECIMA DESK · shell pós-login — UI CANON v1 (docs/ui/UI-CANON-v1.md).
   Preto e grafite, tipografia sem ornamentos, superfície sóbria, espaço
   negativo generoso; sem gradientes chamativos, sem cartões de KPI, sem
   ilustrações sobre a informação. A landing pré-auth vive em landing.css
   (.landing-*), intocada por este ficheiro. */

:root {
  color-scheme: dark;
  --bg: #090a0d;            /* fundo geral */
  --shell: #0c0d10;         /* coluna da shell */
  --surface: #111216;       /* superfícies de trabalho */
  --panel: #141519;         /* cartões/painéis */
  --stroke: #26272b;        /* linhas de separação 1px */
  --stroke-soft: #1e1f23;
  --white: #f4f3f0;         /* branco suave (títulos) */
  --ink: #d6d5d1;           /* texto principal */
  --gray: #a3a4ab;          /* secundário legível */
  --muted: #85868c;         /* terciário */
  --subtle: #75767a;
  --accent: #d1d0ce;        /* acção (botão claro) */
  --safe: #aab8aa;          /* estado concluído (tinta discreta) */
  --alert: #c9b59d;         /* estado à espera (tinta discreta) */
  --danger: #c98080;
  --radius: 12px; --radius-s: 8px;
  --sidebar: 238px; --top: 77px; --detail-w: 340px;
  --font: "Helvetica Neue", "SF Pro Text", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role=button]:focus-visible, a:focus-visible { outline: 2px solid #b8b8bb; outline-offset: 3px; }
a { color: var(--gray); }
svg { display: block; }
button svg, a.ghost svg { width: 14px; height: 14px; flex-shrink: 0; }
::selection { background: #2e2f34; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--white); color: #0a0b0d; padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 99; }
.skip-link:focus { left: 0; }

/* ---------- casca: sidebar escura + frame ---------------------------------------- */

.app { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); height: 100dvh; min-height: 620px; overflow: hidden; }
/* Sem sessão validada, a shell cede o ecrã à landing O / DESK (app.js alterna). */
.app[hidden] { display: none; }
.sidebar { background: #0a0b0e; border-right: 1px solid var(--stroke-soft); color: var(--ink); padding: 30px 20px 18px; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }

/* Marca O / DESK — discreta, no topo (canon §2: identidade da casa discreta). */
.brand { display: flex; align-items: center; gap: 14px; margin: 0 0 40px 10px; user-select: none; }
.brand-mark { line-height: 0; color: #F0EEE6; }
.brand-mark svg { width: 38px; height: 38px; }
/* Halo vivo DECIMA — Ring Language §4 (v6 Eclipse), config canónica do repo ONE:
   coroa respira, rim-fio com o GAP ÚNICO às doze (desenha-se uma vez, nunca se
   move), cometa orbita em 12 s constantes, núcleo respira. Brilho nunca velocidade. */
/* Rim canónico (repo ONE, DecimaRing): dasharray 1245 12 = circunferência
   2π·200≈1256.6 → GAP ÚNICO às doze (corrigido 05/11; nunca o padrão
   repetido herdado do Hospitality, que renderizava 3 gaps). */
.brand-mark .halo-rim { stroke-dasharray: 1245 12; animation: halo-rim-draw 2.4s cubic-bezier(.65, 0, .25, 1) both; }
.brand-mark .halo-comet { transform-origin: 220px 220px; animation: halo-comet-orbit 12s linear infinite; }
.brand-mark .halo-corona { transform-origin: 220px 220px; animation: halo-breathe 5.2s ease-in-out 1.4s infinite; opacity: .75; }
.brand-mark .halo-corona-wide { transform-origin: 220px 220px; animation: halo-breathe-wide 6.8s ease-in-out 1.4s infinite; opacity: 1; }
.brand-mark .halo-core { animation: halo-core 6.4s ease-in-out 2s infinite; opacity: .7; }
@keyframes halo-rim-draw { from { stroke-dashoffset: 1257; opacity: 0; } to { stroke-dashoffset: 12; opacity: 1; } }
@keyframes halo-comet-orbit { to { transform: rotate(360deg); } }
@keyframes halo-breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.05); } }
@keyframes halo-breathe-wide { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.03); } }
@keyframes halo-core { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .brand-mark * { animation: none !important; }
  .brand-mark .halo-comet { transform: rotate(-115deg); }
}
.brand-copy { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font-size: 13px; font-weight: 590; letter-spacing: .39em; color: var(--white); }
.brand-tag { font-size: 9px; letter-spacing: .26em; color: #65676e; text-transform: uppercase; }

.nav-kicker { font-size: 9px; letter-spacing: .19em; text-transform: uppercase; font-weight: 550; color: #68696e; margin: 0 12px 16px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; height: 43px; padding: 0 13px; color: #a3a4a9; background: transparent; border: 1px solid transparent; border-radius: var(--radius-s); font-size: 12px; font-weight: 500; letter-spacing: .015em; transition: color .16s, background .16s, border-color .16s; white-space: nowrap; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .86; }
.nav-item:hover { background: #111216; color: #e5e5e6; }
.nav-item.active { background: #17181c; color: #f2f2f2; border-color: #27282c; }
.nav-item .nav-aux { margin-left: auto; font-size: 10px; color: #99999f; }
.nav-divider { height: 1px; background: var(--stroke-soft); margin: 24px 10px 20px; }

.sidebar-end { margin-top: auto; }
/* Bloco do espaço: identidade da organização (metas desk-org do servidor). */
.tenant-block { border-top: 1px solid var(--stroke-soft); padding: 21px 11px 19px; }
.tenant-overline { font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.tenant-logo img { display: block; width: 100px; height: auto; opacity: .91; }
.tenant-title { margin-top: 9px; font-size: 11px; color: #818287; overflow-wrap: anywhere; }
.signout { height: 43px; border: 0; width: 100%; display: flex; gap: 12px; align-items: center; color: #99999f; background: none; padding: 0 10px; font-size: 12px; border-radius: var(--radius-s); }
.signout:hover { color: #fff; background: #111216; }
.signout svg { width: 16px; height: 16px; }
.mobile-overlay { display: none; }

/* Frame de conteúdo: respiro radial + círculo decorativo único (canon §3). */
.shell { min-width: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--shell); }
.shell::before { content: ""; position: absolute; pointer-events: none; top: -470px; right: -475px; width: 820px; height: 820px; border: 1px solid rgba(255,255,255,.048); border-radius: 50%; }
.topbar { min-height: var(--top); border-bottom: 1px solid var(--stroke-soft); background: rgba(10,11,14,.72); backdrop-filter: blur(24px) saturate(1.1); -webkit-backdrop-filter: blur(24px) saturate(1.1); padding: 0 44px 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 20; flex-shrink: 0; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .topbar { background: #0c0d10; } }
.mobile-menu { display: none; }
.mobile-title { display: none; }
.crumbs { display: flex; align-items: center; gap: 13px; white-space: nowrap; min-width: 0; font-size: 10px; letter-spacing: .115em; text-transform: uppercase; }
.crumb-org { color: #75767a; font-weight: 550; }
.crumb-sep { color: #45464a; }
.crumb-leaf { font-weight: 550; color: #c9c9c7; }
.header-right { display: flex; gap: 21px; align-items: center; min-width: 0; }
.global-search { height: 37px; width: min(320px, 30vw); display: flex; align-items: center; padding: 0 12px; border: 1px solid #2a2b2f; border-radius: var(--radius-s); gap: 10px; color: #787980; background: rgba(0,0,0,.12); }
.global-search svg { width: 13px; height: 13px; flex-shrink: 0; }
.global-search input { width: 100%; min-width: 0; font-size: 11px; color: var(--ink); border: 0; background: none; outline: 0; }
.global-search input::placeholder { color: #6d6e74; }
.kbd { white-space: nowrap; font-size: 10px; color: #57585d; border: 1px solid #2a2b2f; padding: 2px 5px; border-radius: 3px; background: rgba(0,0,0,.2); font-family: inherit; }
.tenant { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #38393c; border-radius: 50%; color: #d5d4d2; background: #25262a; font-weight: 600; font-size: 10px; }

.pagegrid { flex: 1; display: grid; grid-template-columns: minmax(0,1fr) var(--detail-w); min-height: 0; position: relative; z-index: 1; }
.pagegrid.no-detail { grid-template-columns: minmax(0,1fr); }
.pagegrid.no-detail .detail { display: none; }
.primary { min-width: 0; min-height: 0; overflow-y: auto; scroll-behavior: smooth; background: radial-gradient(ellipse 53% 36% at 90% 8%, rgba(255,255,255,.027), transparent 70%), #0f1013; }
.content-wrap { max-width: 1280px; margin: 0 auto; padding: 46px 44px 70px; }
.detail-scrim { display: none; }

/* ---------- tipografia de página --------------------------------------------------- */

.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; font-weight: 550; color: #85858a; margin-bottom: 10px; }
.page-head h1 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; margin: 0 0 8px; color: var(--white); }
.page-head p, .subtitle { font-size: 13px; line-height: 1.65; color: #94949a; margin: 0; }
.intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 30px; }

/* Hero canon (Início) */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 25px; margin-bottom: 44px; }
.hero h1 { font-size: clamp(38px, 3.65vw, 58px); font-weight: 340; letter-spacing: -.055em; line-height: 1.13; margin: 17px 0 12px; color: var(--white); }
.hero-desc { font-size: 13px; color: #a0a1a6; max-width: 550px; line-height: 1.65; margin: 0; }
.hero-side { text-align: right; color: #696a70; font-size: 11px; white-space: nowrap; line-height: 1.8; }
.hero-side .dot { width: 6px; height: 6px; background: #9c9d9b; display: inline-block; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 8px rgba(156,157,155,.21); }

/* Indicadores discretos (canon §2: três indicadores, sem cartões de KPI) */
.overview-strip { display: flex; border-top: 1px solid #292a2e; border-bottom: 1px solid #292a2e; padding: 19px 0 22px; justify-content: space-between; }
.metric { flex: 1; padding: 0 22px; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; }
.metric:first-child { padding-left: 0; }
.metric + .metric { border-left: 1px solid #25262a; }
.metric-number { display: block; font-size: 31px; font-weight: 330; letter-spacing: -.065em; color: var(--white); }
.metric-label { display: block; font-size: 10px; color: #94959b; margin-top: 6px; letter-spacing: .02em; }
.metric-title { display: flex; align-items: baseline; gap: 10px; }
.metric-status { height: 5px; width: 5px; background: #bdb5a6; border-radius: 50%; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 42px 0 15px; }
.section-title { font-size: 18px; font-weight: 430; letter-spacing: -.025em; color: var(--white); margin: 0; }
.section-head h2 { font-size: 17px; letter-spacing: -.025em; font-weight: 430; margin: 0; color: var(--white); }
.section-caption { font-size: 11px; color: #909197; }
.subtle-link { color: #a5a4a3; border: none; background: transparent; font-size: 11px; padding: 5px 0; white-space: nowrap; }
.subtle-link:hover { color: #fff; }

/* Listas finas (assuntos, decisões, documentos) */
.page-list-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--stroke); padding: 16px 0; gap: 10px; flex-wrap: wrap; }
.page-list-head h2 { font-size: 19px; font-weight: 400; margin: 0; color: var(--white); letter-spacing: -.03em; }
.thin-list { border-bottom: 1px solid var(--stroke); }
.task-row { width: 100%; background: transparent; border: none; border-bottom: 1px solid #24252a; display: grid; grid-template-columns: 78px minmax(0,1fr) 18px; gap: 14px; align-items: center; text-align: left; padding: 21px 4px; color: inherit; transition: background .2s; }
.task-row:first-child { border-top: 1px solid var(--stroke); }
.task-row:last-child { border-bottom: none; }
.task-row:hover, .task-row.is-selected { background: linear-gradient(90deg, rgba(255,255,255,.026), transparent 90%); }
.task-row.is-selected .row-title { color: #fff; }
.row-number { font-size: 11px; color: #797a7f; letter-spacing: .05em; align-self: start; margin-top: 2px; }
.row-title { font-size: 13px; font-weight: 490; line-height: 1.45; color: #e0e0df; }
.row-sub { display: block; font-size: 11px; color: #98999f; margin-top: 6px; line-height: 1.4; }
.row-meta { display: block; font-size: 10px; color: #909096; letter-spacing: .055em; margin-top: 10px; }
.tiny-status { font-size: 9px; letter-spacing: .075em; color: #b8b5ac; float: right; font-weight: 400; }
.row-arrow { stroke: #56575c; fill: none; width: 16px; height: 16px; stroke-width: 1.4; transition: transform .2s, stroke .2s; }
.task-row:hover .row-arrow { transform: translateX(3px); stroke: #b8b9bb; }
.empty-note { font-size: 12px; line-height: 1.7; color: #97979b; padding: 28px 4px; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { padding: 7px 10px; color: #85868c; border: 1px solid #303135; background: transparent; font-size: 10px; border-radius: 20px; }
.filter-pill:hover { color: #c9c9c7; }
.filter-pill.is-on { color: #e6e6e8; border-color: #6a6b70; }

/* Feed «Em acompanhamento» */
.feed { border-top: 1px solid var(--stroke); }
.feed-item { display: grid; grid-template-columns: 64px 16px minmax(0,1fr); gap: 11px; padding: 15px 1px 12px; align-items: start; }
.feed-time { color: #83848a; font-size: 10px; padding-top: 3px; }
.feed-mark { width: 6px; height: 6px; border-radius: 100%; border: 1px solid #a0a0a0; margin-top: 6px; }
.feed-title { font-size: 12px; color: #d2d2cf; }
.feed-detail { font-size: 11px; color: #929399; line-height: 1.55; margin-top: 5px; }

/* ---------- painel de contexto (Em foco / inspector) ------------------------------- */

.detail { position: relative; background: var(--shell); border-left: 1px solid var(--stroke-soft); min-width: 0; overflow-y: auto; padding: 30px 28px 34px; scrollbar-width: thin; }
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.detail-caption { color: #909095; letter-spacing: .17em; font-size: 10px; text-transform: uppercase; font-weight: 550; }
.detail-close { display: none; background: #141519; border: 1px solid var(--stroke); width: 26px; height: 26px; border-radius: 50%; place-items: center; color: #8b8b90; }
.detail-close svg { width: 14px; height: 14px; }

/* Cartão de contexto canon (Em foco) */
.context { border: 1px solid #292a2f; border-radius: 13px; background: linear-gradient(160deg, rgba(255,255,255,.032), rgba(255,255,255,.008) 55%, rgba(0,0,0,.08)); padding: 28px 26px 24px; box-shadow: 0 15px 70px rgba(0,0,0,.13); }
.context-top { display: flex; align-items: center; justify-content: space-between; }
.context-label { color: #909095; font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
.context-id { font-size: 10px; color: #88898e; }
.context h2 { font-size: 26px; line-height: 1.17; font-weight: 380; letter-spacing: -.045em; margin: 26px 0 12px; color: var(--white); overflow-wrap: anywhere; }
.context-description { font-size: 12px; color: #a4a4a8; line-height: 1.75; margin: 0 0 22px; }
.context-state { display: flex; gap: 7px; align-items: center; font-size: 11px; color: #c4c0b7; border-bottom: 1px solid #2b2c30; padding-bottom: 22px; }
.status-glyph { display: block; background: #b2afa3; width: 6px; height: 6px; border-radius: 50%; }
.context h3 { font-size: 10px; text-transform: uppercase; letter-spacing: .13em; color: #77787d; font-weight: 550; margin: 26px 0 17px; }
.context-timeline { border-left: 1px solid #45464b; margin-left: 3px; padding-left: 19px; display: grid; gap: 22px; }
.t-item { position: relative; }
.t-item::before { content: ""; position: absolute; top: 4px; left: -23px; width: 7px; height: 7px; background: #141519; border: 1px solid #77777a; border-radius: 50%; }
.t-item b { display: block; font-weight: 480; font-size: 12px; color: #d6d5d3; }
.t-item p { margin: 5px 0 0; font-size: 11px; color: #96969a; line-height: 1.5; }
.context-end { border-top: 1px solid #292a2e; margin-top: 27px; padding-top: 19px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.context-button { border: 1px solid var(--accent); background: var(--accent); color: #121315; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 12px 15px; white-space: nowrap; }
.context-button:hover { background: #fff; border-color: #fff; }
.evidence { font-size: 10px; color: #8b8b8e; line-height: 1.7; }
.evidence b { color: #e0ded9; font-weight: 500; }
.context-empty { font-size: 12px; color: #97979b; line-height: 1.8; padding: 8px 0; }

/* Inspector de documentos */
.preview { height: 170px; background: linear-gradient(145deg, #17181c 0%, #101116 56%, #191a1f 100%); border: 1px solid #26272b; border-radius: 11px; overflow: hidden; position: relative; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; box-shadow: inset 0 1px rgba(255,255,255,.03); }
.preview::before { content: ""; width: 280px; height: 240px; position: absolute; top: -100px; right: -69px; transform: rotate(22deg); border-radius: 20% 20% 50% 50%; border: 1px solid rgba(255,255,255,.05); box-shadow: -15px 10px 45px rgba(255,255,255,.02), -52px 45px 50px rgba(0,0,0,.18); z-index: -1; }
.preview-top { font-size: 11px; font-weight: 650; letter-spacing: .27em; color: #6e6f74; }
.preview-bottom { max-width: 230px; display: flex; flex-direction: column; gap: 7px; }
.preview-type { text-transform: uppercase; font-size: 8px; letter-spacing: .18em; color: #7b7b81; font-weight: 680; }
.preview-title { font-size: 20px; letter-spacing: -.05em; font-weight: 400; line-height: 1.15; color: #d9d9d6; overflow-wrap: anywhere; }
.detail-header { padding: 20px 1px 16px; border-bottom: 1px solid #232428; }
.detail-eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.detail h3 { font-size: 21px; font-weight: 430; letter-spacing: -.045em; line-height: 1.15; margin: 0 0 10px; overflow-wrap: break-word; color: var(--white); }
.detail-subtitle { margin: 0 0 13px; font-size: 12px; line-height: 1.6; color: #85858c; }
.detail-meta { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 10px 8px; padding: 16px 1px; border-bottom: 1px solid #232428; }
.detail-meta .key { color: #99999f; font-size: 11px; }
.detail-meta .value { color: #c9c9c6; font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.detail-tabs { display: flex; gap: 18px; border-bottom: 1px solid #26272b; margin-top: 2px; }
.detail-tab { border: 0; background: none; color: #96969c; font-size: 11px; height: 41px; position: relative; padding: 0; white-space: nowrap; }
.detail-tab.active { color: #e6e6e4; font-weight: 600; }
.detail-tab.active::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 2px; background: #bdb5a6; }
.detail-tab-content { padding: 18px 1px 10px; min-height: 130px; }
.detail-tab-content p { line-height: 1.7; font-size: 12px; color: #96969c; margin: 0 0 14px; }
.detail-tab-content h4 { font-size: 11px; color: #b0b0b4; margin: 0 0 10px; }
.detail-tab-content ul { margin: 0; padding-left: 17px; font-size: 11px; color: #96969c; line-height: 1.8; }
.ver-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--stroke-soft); font-size: 11px; color: #a9a9ae; }
.ver-row strong { font-weight: 600; color: #cfcfcc; }
.cta { background: var(--accent); border: 1px solid var(--accent); color: #121315; border-radius: 8px; width: 100%; height: 45px; font-size: 11px; font-weight: 650; display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 10px; }
.cta:hover { background: #fff; border-color: #fff; }
.cta svg { width: 14px; height: 14px; }
.secondary-btn { width: 100%; background: transparent; border: 1px solid #2a2b2f; color: #9a9ba0; border-radius: var(--radius-s); height: 35px; margin-top: 8px; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 10px; }
.secondary-btn:hover { border-color: #4a4b50; color: #d9d9d6; }
.detail-footer { margin-top: 16px; font-size: 9px; color: #78797f; text-align: center; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- biblioteca de documentos ------------------------------------------------ */

.toolbar { display: flex; gap: 9px; margin-bottom: 18px; position: relative; }
.local-search { border: 1px solid #2a2b2f; height: 40px; border-radius: var(--radius-s); flex: 1; min-width: 0; padding: 0 13px; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.14); }
.local-search svg { width: 15px; height: 15px; color: #6d6e74; flex-shrink: 0; }
.local-search input { width: 100%; border: 0; outline: 0; font-size: 12px; background: none; color: var(--ink); }
.local-search input::placeholder { color: #6d6e74; }
.outline-btn { height: 40px; border: 1px solid #2a2b2f; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 0 13px; border-radius: var(--radius-s); background: transparent; font-size: 11px; font-weight: 600; color: #9a9ba0; }
.outline-btn:hover { border-color: #4a4b50; color: #d9d9d6; }
.outline-btn[aria-expanded="true"] { border-color: #6a6b70; }
.filter-pop { display: none; position: absolute; right: 0; top: 46px; width: 240px; background: var(--panel); border: 1px solid var(--stroke); box-shadow: 0 18px 55px rgba(0,0,0,.5); padding: 16px; border-radius: 13px; z-index: 12; }
.filter-pop.open { display: block; }
.filter-pop h3 { margin: 0 0 10px; font-size: 12px; color: var(--white); }
.filter-pop label { display: flex; align-items: center; gap: 9px; font-size: 11px; color: #a3a4ab; padding: 7px 0; }
.filter-pop input { accent-color: #8b8b90; }
.filter-pop button { border: 0; background: none; color: #a5a4a3; padding: 10px 0 0; text-decoration: underline; text-underline-offset: 3px; font-size: 10px; }
.filters { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid #232428; justify-content: space-between; }
.filter-tabs { display: flex; align-items: center; gap: 20px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { border: 0; background: none; position: relative; color: #89898f; height: 44px; padding: 0 0 1px; display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.filter-tab.active { font-weight: 600; color: #e6e6e4; }
.filter-tab.active::after { content: ""; position: absolute; height: 2px; background: #bdb5a6; left: 0; right: 0; bottom: 0; border-radius: 4px; }
.tab-count { padding: 2px 5px; background: #191a1e; color: #8b8b92; border-radius: 6px; font-size: 9px; font-weight: 600; }
.sort { flex-shrink: 0; display: flex; align-items: center; gap: 7px; color: #929299; font-size: 10px; white-space: nowrap; }
.sort select { max-width: 130px; border: 0; outline: 0; font-weight: 600; font-size: 11px; background: transparent; color: #b0b0b4; cursor: pointer; }

.document-groups { margin-top: 6px; }
.group { margin-bottom: 14px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #71717a; }
.group-count { background: #191a1e; color: #8b8b92; font-weight: 600; border-radius: 5px; padding: 3px 5px; font-size: 9px; letter-spacing: 0; }
.doc-table { border-top: 1px solid var(--stroke); }
.doc-row { min-width: 0; width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) 40px 84px 88px 18px; gap: 13px; align-items: center; padding: 13px 10px 13px 4px; border: 1px solid transparent; border-bottom-color: #24252a; border-radius: var(--radius-s); background: transparent; text-align: left; color: var(--ink); transition: background .16s ease, border-color .16s ease; }
.doc-row:hover { background: rgba(255,255,255,.026); }
.doc-row.selected { background: linear-gradient(130deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); border: 1px solid #2e2f34; }
.file-icon { width: 37px; height: 41px; flex-shrink: 0; border-radius: 7px; border: 1px solid #26272b; background: linear-gradient(141deg, #191a1f 0%, #121317 56%, #1e1f24 100%); position: relative; overflow: hidden; display: grid; place-items: center; }
.file-icon.dark { background: linear-gradient(141deg, #232429 0%, #16171b 56%, #101116 100%); }
.file-icon::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 3px; }
.file-icon svg { position: relative; z-index: 2; width: 15px; height: 15px; color: #8e8f95; }
.doc-copy { min-width: 0; }
.doc-name { font-size: 12.5px; font-weight: 640; color: #e4e4e2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: block; }
.doc-description { font-size: 11px; color: #93939a; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 5px 0 0; display: block; }
.doc-tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.doc-tag { background: #191a1e; color: #8b8b92; padding: 3px 6px; font-size: 9px; border-radius: 5px; }
.doc-meta { color: #83848a; font-size: 10.5px; white-space: nowrap; }
.status-pill { color: #9a9ba1; border: 1px solid #2a2b2f; background: #141519; border-radius: 20px; padding: 5px 8px; font-size: 9px; font-weight: 700; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.status-pill .small-dot { width: 4px; height: 4px; border-radius: 50%; background: #8b8b90; }
.status-pill.internal { color: #c9c9c7; border-color: #3a3b40; background: #191a1f; }
.doc-more { color: #6d6e73; display: grid; place-items: center; }
.doc-more svg { width: 15px; height: 15px; }
.new-mark { display: inline-block; vertical-align: middle; font-size: 8px; letter-spacing: .025em; font-weight: 750; border-radius: 5px; padding: 3px 4px; background: #23241f; color: #bdb5a6; margin-left: 7px; }
.footnote { font-size: 9px; color: #78797f; line-height: 1.5; margin-top: 16px; }
.empty { margin-top: 22px; background: var(--surface); padding: 32px 24px; border: 1px solid var(--stroke-soft); border-radius: 13px; color: #97979b; font-size: 12px; text-align: center; }

/* ---------- componentes partilhados ------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--stroke-soft); border-radius: 13px; padding: 18px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.hint { font-size: .78rem; color: #8f8f96; line-height: 1.6; }
.row { display: flex; gap: 10px; align-items: center; }
.btn { background: var(--accent); color: #121315; border: 1px solid var(--accent); border-radius: 8px; padding: 10px 16px; font-size: 12px; font-weight: 650; }
.btn:hover { background: #fff; border-color: #fff; }
.btn.danger { background: transparent; color: #d8b4b0; border-color: #4a3230; }
.btn.danger:hover { border-color: #6a4642; }
.ghost { background: transparent; border: 1px solid #2a2b2f; color: #bcbcc1; border-radius: var(--radius-s); padding: 8px 12px; font-size: 11px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.ghost:hover { background: #191a1e; color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 20px; border: 1px solid #2a2b2f; background: #141519; color: #a9a9ae; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; }
.badge.green { background: rgba(170,184,170,.09); border-color: rgba(170,184,170,.30); color: #c2cfc2; }
.badge.amber { background: rgba(201,181,157,.08); border-color: rgba(201,181,157,.28); color: #d3c4ac; }
.badge.red { background: rgba(201,128,128,.10); border-color: rgba(201,128,128,.34); color: #d8aeae; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 11px; font-weight: 600; color: #a3a4ab; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #26272b; border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; background: #0e0f12; color: var(--ink); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #8b8c90; box-shadow: 0 0 0 3px rgba(139,140,144,.14); }
.field select { color-scheme: dark; }

/* leitor de documento */
.doc-article { max-width: 720px; }
.doc-article h1 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 400; letter-spacing: -.045em; margin: 0 0 10px; color: var(--white); }
.doc-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 26px; color: var(--muted); font-size: 11px; }
.doc-article section { border-top: 1px solid var(--stroke-soft); padding: 20px 0; }
.doc-article section h2 { font-size: 16px; font-weight: 640; letter-spacing: -.02em; margin: 0 0 10px; color: #e4e4e2; }
.doc-article p { line-height: 1.75; font-size: 13.5px; color: #c2c2bf; margin: 0 0 12px; }
.doc-article li { line-height: 1.7; font-size: 13.5px; color: #c2c2bf; }
.doc-article table { border-collapse: collapse; width: 100%; font-size: 12px; margin: 10px 0; }
.doc-article th, .doc-article td { border: 1px solid var(--stroke); padding: 8px 10px; text-align: left; }
.doc-article th { background: var(--panel); font-weight: 640; }
.propose-link { background: none; border: 0; padding: 8px 0 0; color: #9a9ba0; font-size: 11px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.propose-link:hover { color: #fff; }

.proposal { border: 1px solid var(--stroke-soft); border-radius: 12px; padding: 14px; margin: 10px 0; background: var(--surface); }
.proposal .body { font-size: 12.5px; line-height: 1.65; color: #c2c2bf; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.proposal small { color: #85858b; }
.proposal .actions { display: flex; gap: 8px; margin-top: 12px; }

/* diálogos + toast */
dialog { background: var(--panel); border-radius: 16px; box-shadow: 0 27px 95px rgba(0,0,0,.55); padding: 26px; border: 1px solid var(--stroke); max-width: min(560px, 92vw); color: var(--ink); }
dialog::backdrop { background: rgba(4,5,7,.62); backdrop-filter: blur(6px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal-head h2 { font-size: 20px; font-weight: 550; letter-spacing: -.03em; margin: 0; color: var(--white); }
.modal-head .close { border: 0; background: none; color: #8b8b90; font-size: 14px; padding: 6px; }
.modal-body blockquote { margin: 0 0 14px; padding: 10px 14px; background: #0e0f12; border: 1px solid var(--stroke-soft); border-radius: 10px; font-size: 12.5px; color: #c2c2bf; max-height: 160px; overflow: auto; white-space: pre-wrap; }
.toast { position: fixed; bottom: 24px; right: 26px; z-index: 60; background: #1d1e22; border: 1px solid var(--stroke); color: #e8e8e4; font-size: 11px; padding: 13px 17px; border-radius: 10px; box-shadow: 0 12px 45px rgba(0,0,0,.45); opacity: 0; transform: translateY(7px); pointer-events: none; transition: opacity .22s, transform .22s; max-width: 340px; line-height: 1.6; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast strong { display: block; margin-bottom: 2px; }

/* ---------- governança operacional (staff) ------------------------------------------ */

.board-filter { height: 35px; font-size: 11px; }
.board-filter.active { border-color: #6a6b70; color: #e6e6e8; font-weight: 600; }
.board-action { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--stroke-soft); flex-wrap: wrap; }
.board-action:first-of-type { border-top: 0; }
.board-log { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: #96969c; display: grid; gap: 4px; }
.board-log code { font-size: 11px; }
.board-validate { border: 1px solid var(--stroke-soft); border-radius: var(--radius-s); padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); }
.board-validate.board-approved { border-color: rgba(170,184,170,.30); background: rgba(170,184,170,.06); }

/* ---------- conversas --------------------------------------------------------------- */

.chat-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 12px; align-items: start; }
.chat-side { display: flex; flex-direction: column; gap: 8px; }
.chat-conv { border: 1px solid var(--stroke-soft); background: var(--surface); border-radius: 10px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.chat-conv small { color: #85858b; }
.chat-conv.active { border-color: #6a6b70; box-shadow: 0 0 0 1px #6a6b70; }
.chat-main { display: flex; flex-direction: column; min-height: 420px; max-height: 68vh; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--stroke-soft); }
.chat-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 2px; }
.chat-msg { max-width: 78%; }
.chat-msg.mine { align-self: flex-end; text-align: right; }
.chat-msg small { color: #8f8f96; font-size: 10px; }
.chat-bubble { background: var(--panel); border: 1px solid var(--stroke-soft); border-radius: 14px; padding: 10px 13px; font-size: 12.5px; line-height: 1.6; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: #c9c9c6; }
.chat-msg.mine .chat-bubble { background: #d1d0ce; border-color: #d1d0ce; color: #121315; }
.chat-form { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--stroke-soft); }
.chat-form input { flex: 1; border: 1px solid #26272b; border-radius: 10px; padding: 10px 12px; font-size: 13px; background: #0e0f12; color: var(--ink); }

/* ---------- sala de reunião ---------------------------------------------------------- */

.sala-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 12px; margin-top: 6px; }
.sala-pane { border: 1px solid var(--stroke-soft); border-radius: 13px; overflow: hidden; background: #0c0d10; }
.sala-pane iframe { width: 100%; height: min(62vh, 560px); border: 0; display: block; }
.sala-video iframe { min-height: 420px; }
.sala-assistente { background: #101116; }
/* Sala completa dentro da shell: embebe /meeting/ por inteiro */
.sala-grid.sala-full { grid-template-columns: 1fr; }
.sala-grid.sala-full .sala-pane iframe { height: min(82vh, 900px); min-height: 560px; }

/* ---------- responsividade ------------------------------------------------------------ */

@media (min-width: 1600px) {
  .app { grid-template-columns: 238px minmax(0,1fr); }
  .pagegrid { grid-template-columns: minmax(0,1fr) 375px; }
  .content-wrap { max-width: 1420px; padding: 54px 52px 80px; }
}
@media (max-width: 1280px) {
  :root { --sidebar: 202px; --detail-w: 310px; }
  .content-wrap { padding: 36px 30px 70px; }
  .topbar { padding: 0 30px 0 22px; }
  .detail { padding: 25px 20px; }
  .doc-row { gap: 8px; grid-template-columns: 34px minmax(0,1fr) 30px 64px 70px 14px; padding-left: 6px; padding-right: 4px; }
  .file-icon { width: 32px; height: 38px; }
  .hero h1 { font-size: 46px; }
}
@media (max-width: 1070px) {
  .pagegrid { grid-template-columns: minmax(0,1fr); }
  .detail { position: fixed; z-index: 32; width: min(390px, 100%); right: 0; top: 0; bottom: 0; transform: translateX(104%); box-shadow: -25px 0 75px rgba(0,0,0,.45); transition: transform .25s ease; padding: 25px; background: var(--shell); }
  .detail.open { transform: translateX(0); }
  .detail-close { display: grid; }
  .detail-scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; }
  .content-wrap { max-width: 100%; padding: 34px 32px 70px; }
  .hero-side { display: none; }
}
@media (max-width: 720px) {
  .app { display: block; min-height: 100dvh; height: auto; }
  .sidebar { width: 250px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 35; }
  .shell { height: 100dvh; }
  .topbar { padding: 0 15px 0 10px; gap: 12px; }
  .mobile-menu { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #2c2d33; border-radius: 7px; background: transparent; color: #d0d0d0; margin-right: 4px; }
  .mobile-menu svg { width: 18px; height: 18px; }
  .crumbs { display: none; }
  .mobile-title { display: block; font-size: 13px; letter-spacing: .29em; color: var(--white); }
  .header-right { gap: 12px; }
  .global-search { width: 34px; border: 0; background: transparent; padding: 0 7px; }
  .global-search input, .global-search .kbd { display: none; }
  .global-search.expanded { width: 190px; background: #0e0f12; border: 1px solid #2a2b2f; padding: 0 9px; }
  .global-search.expanded input { display: block; }
  .content-wrap { padding: 30px 20px 60px; }
  .intro { flex-direction: column; }
  .hero { margin-bottom: 34px; }
  .hero h1 { font-size: 44px; margin-top: 12px; }
  .hero-desc { font-size: 12px; }
  .overview-strip { padding: 17px 0; flex-wrap: wrap; gap: 14px 0; }
  .metric { padding: 0 10px; }
  .metric-number { font-size: 25px; }
  .metric-label { font-size: 9px; }
  .section-head { margin-top: 36px; }
  .task-row { grid-template-columns: 46px 1fr 12px; gap: 8px; }
  .row-meta { line-height: 1.5; }
  .filters { display: block; }
  .sort { padding: 10px 0 11px; }
  .filter-tabs { gap: 19px; }
  .doc-row { grid-template-columns: 32px minmax(0,1fr) 13px; gap: 10px; }
  .doc-row .doc-meta, .doc-row .status-pill, .doc-row .doc-more { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .sala-grid { grid-template-columns: 1fr; }
  .context { padding: 22px 18px 20px; }
  .footer-note { line-height: 1.8; }
  .filter-pills { flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .content-wrap { padding: 28px 16px 50px; }
  .hero h1 { font-size: 40px; }
  .metric-number { font-size: 22px; }
  .task-row { grid-template-columns: 40px 1fr 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
