:root {
  --ink: #1b2530;
  --muted: #667381;
  --line: #dfe4e8;
  --line-soft: #edf0f2;
  --paper: #ffffff;
  --canvas: #f4f5f3;
  --navy: #182b3b;
  --navy-2: #223c50;
  --gold: #ad8743;
  --gold-soft: #f4ead7;
  --green: #35735a;
  --red: #9d4c4c;
  --shadow: 0 8px 28px rgba(24, 43, 59, .08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #dce4ea; padding: 24px 16px 18px; position: fixed; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 25px; border-bottom: 1px solid rgba(255,255,255,.10); }
.brand-mark, .login-emblem { width: 46px; height: 46px; border: 1px solid rgba(214,179,111,.75); display: grid; place-items: center; border-radius: 50%; color: #e1bc72; font-family: Georgia, serif; font-weight: 700; letter-spacing: -.04em; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 16px; color: white; }
.brand small { display: block; color: #8fa1af; margin-top: 3px; }
.main-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 23px; overflow: auto; }
.main-nav a { display: grid; grid-template-columns: 24px 1fr; gap: 9px; align-items: center; padding: 10px 12px; border-radius: 8px; color: #bdc9d2; font-size: 14px; }
.main-nav a span { color: #9fb0bd; text-align: center; font-size: 17px; }
.main-nav a:hover { background: rgba(255,255,255,.06); color: white; }
.main-nav a.active { background: var(--navy-2); color: white; box-shadow: inset 3px 0 var(--gold); }
.main-nav a.active span { color: #e2ba6e; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 18px 8px 0; display: flex; flex-direction: column; gap: 12px; }
.read-only-pill { border: 1px solid rgba(225,188,114,.35); color: #e1bc72; padding: 6px 9px; font-size: 11px; border-radius: 99px; width: max-content; text-transform: uppercase; letter-spacing: .08em; }
.nav-logout { background: none; border: 0; padding: 0; color: #94a5b2; }
.nav-logout:hover { color: white; }
.main-content { grid-column: 2; min-width: 0; }
.topbar { height: 70px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 34px; gap: 24px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.quick-search { max-width: 640px; width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #fafbfb; }
.quick-search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }
kbd { border: 1px solid var(--line); background: white; border-radius: 4px; padding: 2px 6px; font-size: 10px; color: var(--muted); }
.topbar-meta { margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4aa071; box-shadow: 0 0 0 3px #dff0e7; }
.mobile-menu { display: none; background: none; border: 0; font-size: 21px; }
.page-container { max-width: 1500px; margin: 0 auto; padding: 38px 38px 60px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font: 500 34px/1.2 Georgia, serif; margin: 4px 0 8px; color: #182a38; }
.page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.heading-row { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.eyebrow { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.button { min-height: 40px; border-radius: 7px; padding: 9px 15px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; }
.button-primary { background: var(--navy); color: white; }
.button-primary:hover { background: var(--navy-2); }
.button-secondary { background: white; border-color: #bdc8d0; color: var(--navy); }
.button-ghost { background: transparent; color: var(--muted); }
.button-full { width: 100%; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 19px; box-shadow: 0 2px 10px rgba(24,43,59,.035); transition: transform .15s, box-shadow .15s; }
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-card span { display: block; font-size: 12px; color: var(--muted); }
.metric-card strong { display: block; font: 500 30px Georgia, serif; margin: 9px 0 2px; }
.metric-card small { color: #8b969e; font-size: 11px; }
.metric-warning { border-top: 3px solid var(--gold); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 14px rgba(24,43,59,.04); overflow: hidden; }
.panel-span-2 { grid-column: 1; }
.panel-heading { min-height: 66px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2 { font: 500 20px Georgia, serif; margin: 2px 0 0; }
.panel-heading > a { color: var(--gold); font-size: 12px; font-weight: 700; }
.document-row { display: grid; grid-template-columns: 48px 1fr 20px; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.document-row:last-child { border: 0; }
.document-row:hover, .compact-card:hover { background: #fbfaf7; }
.date-tile { width: 44px; height: 44px; border: 1px solid #d6c5a6; background: #faf6ed; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #765d31; }
.date-tile strong { font-size: 16px; line-height: 1; }
.date-tile small { font-size: 9px; margin-top: 4px; }
.document-row-main strong { display: block; font-size: 14px; margin-bottom: 6px; }
.document-row-main small { color: var(--muted); font-size: 11px; }
.row-arrow { color: #9aa5ac; font-size: 23px; }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 8px; font-size: 10px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.badge-grade { color: #765d31; background: var(--gold-soft); }
.badge-type { color: #2d5269; background: #e6eef3; }
.badge-neutral { color: #59636b; background: #edf0f2; }
.system-status { padding: 5px 20px 10px; margin: 0; }
.system-status div { display: flex; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.system-status div:last-child { border: 0; }
.system-status dt { color: var(--muted); }
.system-status dd { margin: 0; text-align: right; }
.status-ok { color: var(--green); font-weight: 700; }
.cards-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.compact-card { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line-soft); }
.compact-card:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.compact-card strong { display: block; font-size: 13px; }
.compact-card small { color: var(--muted); display: block; margin-top: 4px; }
.type-icon { width: 32px; height: 32px; border: 1px solid #d8c7aa; border-radius: 50%; display: grid; place-items: center; color: var(--gold); }
.mini-list { padding: 7px 20px 12px; }
.mini-list a, .side-list > a { display: block; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.mini-list a:last-child, .side-list > a:last-child { border: 0; }
.mini-list span { font-size: 12px; display: block; }
.mini-list small, .side-list small { color: var(--muted); display: block; margin-top: 4px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); background: white; border-radius: 10px; }
.filter-bar label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; min-width: 150px; }
select, .login-form input { height: 40px; border: 1px solid #ccd4da; background: white; border-radius: 7px; padding: 0 10px; color: var(--ink); }
.table-panel { overflow-x: auto; }
.archive-table { min-width: 790px; }
.archive-table-head, .archive-table-row { display: grid; grid-template-columns: minmax(320px, 2.5fr) 120px 65px 110px minmax(140px, 1fr); gap: 16px; align-items: center; }
.archive-table-head { padding: 12px 18px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: #f8f9f9; border-bottom: 1px solid var(--line); }
.archive-table-row { padding: 13px 18px; font-size: 12px; border-bottom: 1px solid var(--line-soft); }
.archive-table-row:hover { background: #fbfaf7; }
.table-title strong { display: block; font-size: 13px; }
.table-title small { display: block; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 24px; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--navy); font-weight: 700; }
.search-page-form { display: grid; grid-template-columns: minmax(280px, 1fr) 170px 140px auto; gap: 10px; margin-bottom: 24px; }
.search-large { height: 46px; display: flex; align-items: center; gap: 10px; border: 1px solid #c8d0d6; background: white; border-radius: 8px; padding: 0 13px; }
.search-large input { width: 100%; border: 0; outline: 0; }
.search-page-form select { height: 46px; }
.result-summary { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.search-results { display: grid; gap: 12px; }
.search-result { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.search-result:hover { border-color: #b7a37e; box-shadow: var(--shadow); }
.result-topline { display: flex; align-items: center; gap: 7px; }
.result-topline time { margin-left: auto; color: var(--muted); font-size: 11px; }
.search-result h2 { font: 500 19px Georgia, serif; margin: 12px 0 8px; }
.search-result p { margin: 0 0 10px; color: #4e5a63; line-height: 1.55; font-size: 13px; }
.search-result small { color: #89949b; }
mark { background: #f5dfad; padding: 1px 2px; }
.search-help { padding: 22px; }
.search-help h2 { font: 500 20px Georgia, serif; margin-top: 0; }
.search-examples { display: flex; flex-wrap: wrap; gap: 10px; }
.search-examples a { border: 1px solid var(--line); border-radius: 99px; padding: 8px 13px; color: var(--navy); font-size: 12px; }
.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: 11px; margin-bottom: 24px; white-space: nowrap; overflow: hidden; }
.breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; }
.document-header { display: flex; justify-content: space-between; align-items: end; gap: 25px; padding-bottom: 25px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.document-header h1 { font: 500 35px/1.18 Georgia, serif; max-width: 900px; margin: 10px 0 8px; }
.header-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.document-path { color: var(--muted); font-size: 11px; margin: 0; }
.document-actions { display: flex; gap: 8px; flex-shrink: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.markdown-panel { padding: 32px 38px; overflow: visible; }
.markdown-body { font: 16px/1.75 Georgia, serif; color: #29343c; }
.markdown-body h1 { display: none; }
.markdown-body h2 { font: 500 24px/1.3 Georgia, serif; color: #182c3b; margin: 2.1em 0 .7em; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.markdown-body h2:first-child { margin-top: 0; }
.markdown-body h3 { color: #263c4b; margin-top: 1.7em; }
.markdown-body p { margin: 0 0 1em; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; }
.markdown-body a { color: #315f7b; text-decoration: underline; text-decoration-color: #aabdc8; text-underline-offset: 3px; }
.markdown-body blockquote { border-left: 3px solid var(--gold); margin: 1.4em 0; padding: 10px 18px; color: #5e5648; background: #fbf7ef; }
.markdown-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84em; background: #f0f2f3; padding: 2px 5px; border-radius: 4px; }
.markdown-body table { width: 100%; border-collapse: collapse; font-family: inherit; font-size: .9em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.detail-sidebar { display: grid; gap: 16px; position: sticky; top: 90px; }
.metadata-panel dl { margin: 0; padding: 8px 18px 16px; }
.metadata-panel dl div { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.metadata-panel dl div:last-child { border: 0; }
.metadata-panel dt { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.metadata-panel dd { margin: 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.side-list { padding-bottom: 8px; }
.side-list .panel-heading { min-height: 54px; padding: 12px 16px; }
.side-list .panel-heading h2 { font-size: 16px; }
.side-list > a { margin: 0 16px; }
.side-list strong { display: block; font-size: 11px; line-height: 1.4; }
.empty-state { color: var(--muted); font-size: 12px; }
.empty-state.padded { padding: 30px; }
.empty-state.large { padding: 50px; text-align: center; background: white; border: 1px dashed #cbd2d7; border-radius: 10px; }
.alert { padding: 12px 14px; border-radius: 7px; margin: 14px 0; font-size: 13px; }
.alert-error { background: #f8e8e8; color: #843f3f; border: 1px solid #e8c3c3; }
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > span { font: 600 80px Georgia, serif; color: #d8c6a5; }
.error-page h1 { font: 500 30px Georgia, serif; margin: 0; }
.error-page p { color: var(--muted); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #29455a 0, #182b3b 45%, #11202b 100%); }
.login-card { width: min(420px, 100%); background: white; border-radius: 16px; padding: 40px; box-shadow: 0 24px 70px rgba(0,0,0,.28); text-align: center; }
.login-emblem { margin: 0 auto 20px; width: 64px; height: 64px; color: #9a773a; border-color: #b7975b; font-size: 21px; }
.login-card h1 { font: 500 30px Georgia, serif; margin: 7px 0; }
.login-description { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 22px; }
.login-form { text-align: left; display: grid; gap: 15px; }
.login-form label { color: #48545e; font-size: 12px; font-weight: 650; display: grid; gap: 6px; }
.login-note { color: #8b959d; font-size: 10px; margin: 20px 0 0; }
@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .search-page-form { grid-template-columns: 1fr 160px 130px; }
  .search-page-form .button { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .main-content { min-width: 0; }
  .mobile-menu { display: block; }
  .topbar { padding: 0 18px; }
  .topbar-meta, kbd { display: none; }
  .page-container { padding: 28px 20px 50px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-span-2 { grid-column: auto; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .document-header { align-items: start; flex-direction: column; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 14px; }
  .cards-list { grid-template-columns: 1fr; }
  .compact-card:nth-child(odd) { border-right: 0; }
  .heading-row { display: block; }
  .heading-row form { margin-top: 16px; }
  .search-page-form { grid-template-columns: 1fr; }
  .search-page-form .button { grid-column: auto; }
  .filter-bar > * { flex: 1 1 100%; }
  .document-header h1 { font-size: 28px; }
  .document-actions { width: 100%; }
  .document-actions .button { flex: 1; }
  .markdown-panel { padding: 22px 20px; }
  .login-card { padding: 30px 24px; }
}
/* Grafo documental — versão 1.1.0 */
.graph-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.graph-app { display: grid; grid-template-columns: 245px minmax(0, 1fr) 265px; gap: 16px; min-height: calc(100vh - 235px); }
.graph-controls, .graph-inspector { align-self: stretch; overflow: hidden; }
.graph-control-body { display: grid; gap: 14px; padding: 16px; }
.graph-control-body label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.graph-control-body select, .graph-node-search { width: 100%; height: 40px; border: 1px solid #ccd4da; border-radius: 7px; background: white; padding: 0 10px; color: var(--ink); }
.checkbox-control { grid-template-columns: auto 1fr !important; align-items: center; color: var(--ink) !important; }
.checkbox-control input { width: 16px; height: 16px; }
.graph-control-body hr { width: 100%; border: 0; border-top: 1px solid var(--line-soft); margin: 2px 0; }
.button-full { width: 100%; justify-content: center; text-align: center; }
.graph-button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.graph-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.graph-canvas-panel { min-height: 620px; position: relative; overflow: hidden; }
.graph-toolbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.graph-toolbar strong { display: block; font-size: 13px; }
.graph-toolbar small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.graph-zoom-controls { display: flex; gap: 5px; }
.graph-zoom-controls button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--navy); font-size: 18px; cursor: pointer; }
.graph-canvas { width: 100%; height: calc(100% - 60px); min-height: 560px; background: radial-gradient(circle at center, #ffffff 0, #fafbfb 65%, #f2f5f6 100%); }
.graph-loading { position: absolute; inset: 60px 0 0; display: grid; place-items: center; background: rgba(250,252,252,.82); color: var(--muted); font: 16px Georgia, serif; z-index: 5; }
.graph-loading[hidden] { display: none; }
.graph-inspector-empty { padding: 24px 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.graph-inspector-content { padding: 18px; }
.graph-inspector-content h2 { font: 500 21px/1.3 Georgia, serif; margin: 14px 0 18px; }
.graph-inspector-content dl { margin: 0 0 18px; }
.graph-inspector-content dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 9px 0; font-size: 11px; }
.graph-inspector-content dt { color: var(--muted); }
.graph-inspector-content dd { margin: 0; text-align: right; }
.graph-inspector-content .button + .button { margin-top: 8px; }
.graph-legend { border-top: 1px solid var(--line); margin-top: 8px; padding: 16px 18px; display: grid; gap: 9px; }
.graph-legend h3 { margin: 0 0 3px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.graph-legend span { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.graph-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 50%; background: #60727d; }
.graph-legend .legend-person { background: #9b6a42; }
.graph-legend .legend-session { background: #2f6682; border-radius: 3px; }
.graph-legend .legend-work { background: #9a7a36; transform: rotate(45deg); border-radius: 1px; }
.graph-legend .legend-decision { background: #8a4650; border-radius: 3px; }
.graph-legend .legend-event { background: #53745d; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.graph-local-button { margin-left: 8px; }
@media (max-width: 1180px) { .graph-app { grid-template-columns: 220px minmax(0, 1fr); } .graph-inspector { grid-column: 1 / -1; } .graph-inspector-content { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; } }
@media (max-width: 900px) { .graph-app { grid-template-columns: 1fr; } .graph-controls, .graph-inspector { grid-column: auto; } .graph-canvas-panel { min-height: 520px; } .graph-canvas { min-height: 460px; } .graph-heading { align-items: start; flex-direction: column; } }

/* Perfis e controlo de acessos — v1.2.0 */
.profile-summary { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; margin: 14px 7px 0; padding: 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.035); }
.profile-summary strong { display: block; color: #fff; font-size: 12px; }
.profile-summary small { display: block; color: #91a4b2; margin-top: 3px; font-size: 10px; }
.profile-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); border: 1px solid #d4b879; color: #6f5528; font-family: Georgia, serif; font-weight: 700; }
.profile-avatar.large { width: 48px; height: 48px; font-size: 20px; }
.profile-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; background: var(--gold-soft); color: #765d31; font-size: 11px; font-weight: 700; }
.signed-user { color: #8fa1af; font-size: 11px; }
.metric-access { border-top: 3px solid var(--green); }
.profile-login-guide { display: grid; gap: 6px; margin-top: 15px; padding: 12px; background: #f6f7f7; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; color: var(--muted); text-align: left; }
.profile-login-guide strong { color: var(--navy); }
.access-warning { padding: 15px 18px; margin-bottom: 20px; border: 1px solid #dbc492; background: #fbf5e8; border-radius: 10px; color: #5f4c2b; font-size: 13px; }
.profile-cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.profile-card { padding: 18px; }
.profile-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-card h2 { margin: 2px 0 0; font: 500 18px Georgia, serif; }
.profile-card > p { color: var(--muted); font-size: 12px; min-height: 54px; }
.profile-card dl { margin: 15px 0 0; }
.profile-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 11px; }
.profile-card dt { color: var(--muted); }
.profile-card dd { margin: 0; text-align: right; font-weight: 650; }
.access-matrix { margin-bottom: 20px; }
.access-table { padding: 0 20px 12px; }
.access-table-row { display: grid; grid-template-columns: 1.2fr 2fr 90px; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; align-items: center; }
.access-table-row.head { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.access-table-row strong { text-align: right; font: 500 22px Georgia, serif; }
.access-test-steps ol { margin: 0; padding: 18px 40px 24px; color: var(--muted); font-size: 13px; }
.access-test-steps li { margin: 8px 0; }
.access-test-steps code { color: var(--navy); font-weight: 700; }
@media (max-width: 1100px) { .profile-cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .profile-cards { grid-template-columns: 1fr; } .profile-pill { display: none; } .access-table-row { grid-template-columns: 1fr; gap: 4px; } .access-table-row strong { text-align: left; } }

/* Fase 2A — operação documental */
.button.primary, .button-primary { background: var(--navy); color: white; }
.button.primary:hover, .button-primary:hover { background: var(--navy-2); }
.button.secondary, .button-secondary { background: white; border-color: #bdc8d0; color: var(--navy); }
.button.ghost, .button-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.button.danger { background: #8a3f46; color: #fff; }
.button.danger:hover { background: #72333a; }
.small-button { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.top-gap { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.notice { margin-bottom: 18px; padding: 13px 16px; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; }
.notice.success { background: #edf7f0; border-color: #b5d8c0; color: #285d3c; }
.notice.warning { background: #fff6e8; border-color: #dec28b; color: #6e5121; }
.credentials-panel { margin-bottom: 18px; padding: 16px; border: 1px solid #b9d2c2; background: #eff8f2; border-radius: 10px; }
.credentials-panel > p { color: var(--muted); font-size: 12px; }
.credential-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; }
.credential-row code { padding: 8px 10px; background: white; border: 1px solid #d5e4d9; border-radius: 6px; overflow-wrap: anywhere; }
.credential-row button { border: 1px solid #aac4b2; background: white; border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.inline-form label { display: grid; gap: 5px; font-size: 10px; color: var(--muted); }
.inline-form select { height: 36px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 0 8px; }
.split-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.operation-metrics { margin-bottom: 20px; }
.metric-card.warning { border-top: 3px solid #b9872f; }
.metric-card.danger { border-top: 3px solid #a34b54; }
.operation-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.operation-action { min-height: 135px; display: grid; align-content: start; gap: 7px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); box-shadow: var(--shadow); }
.operation-action:hover { border-color: #b7a06e; transform: translateY(-1px); }
.operation-action > span, .operation-action button > span { font-size: 22px; color: var(--gold); }
.operation-action strong, .operation-action button > strong { font: 500 17px Georgia, serif; }
.operation-action small, .operation-action button > small { color: var(--muted); line-height: 1.45; }
.action-form { padding: 0; }
.action-form button { width: 100%; min-height: 135px; display: grid; text-align: left; align-content: start; gap: 7px; padding: 17px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.phase-boundary { margin-top: 20px; padding: 16px 18px; border-left: 4px solid var(--gold); background: #faf6ed; color: #5c4b2c; border-radius: 0 8px 8px 0; }
.phase-boundary p { margin: 6px 0 0; font-size: 12px; line-height: 1.55; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { text-align: left; padding: 11px 13px; background: #f7f9f9; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-size: 12px; }
.data-table tr:hover td { background: #fcfbf8; }
.table-subline { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: #eef1f2; color: #4e5e68; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge.large { padding: 7px 12px; font-size: 11px; }
.status-inventoried, .status-ready_review { background: #e9f5ed; color: #28613d; }
.status-duplicates_detected, .status-duplicate_exact { background: #fff2d9; color: #745016; }
.status-requires_attention, .status-invalid { background: #f9e7e8; color: #7c3139; }
.status-rejected { background: #eceff1; color: #56616a; }
.upload-form { padding: 22px; }
.form-grid.two-columns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; }
.upload-form label:not(.dropzone), .filter-bar label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.upload-form select, .upload-form textarea, .filter-bar select { width: 100%; border: 1px solid #c8d1d7; border-radius: 7px; background: white; padding: 10px; color: var(--ink); }
.upload-form select { height: 43px; }
.upload-form small { color: var(--muted); line-height: 1.45; }
.dropzone { margin-top: 20px; min-height: 210px; display: grid; place-items: center; align-content: center; gap: 8px; border: 2px dashed #b9c6ce; border-radius: 12px; background: #fafcfc; cursor: pointer; text-align: center; transition: .15s ease; }
.dropzone:hover, .dropzone.dragover { border-color: var(--gold); background: #fffaf0; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.dropzone-icon { font-size: 34px; color: var(--gold); }
.selected-files { margin-top: 12px; padding: 12px 14px; background: #f7f9f9; border-radius: 8px; color: var(--muted); font-size: 11px; }
.selected-files ul { margin: 0; padding-left: 18px; }
.selected-files li { margin: 4px 0; }
.upload-limits { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.filter-bar { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; }
.filter-bar select { min-width: 230px; height: 40px; padding: 0 10px; }
.batch-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.batch-summary-grid article { padding: 14px 16px; border: 1px solid var(--line); background: white; border-radius: 8px; }
.batch-summary-grid span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.batch-summary-grid strong { display: block; margin-top: 7px; font: 500 18px Georgia, serif; }
.hash-code { white-space: nowrap; font-size: 10px; }
.duplicate-reference { display: block; margin-top: 5px; color: #775720; font-size: 10px; line-height: 1.4; }
.duplicate-kind { display: inline-block; text-transform: uppercase; font-size: 9px; font-weight: 700; color: #75551c; }
.batch-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 16px; }
.inline-action { margin-top: 6px; }
.inline-action button { border: 0; background: transparent; color: var(--navy); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.status-not_started { background: #eef1f3; color: #5c6670; }
.status-extracted { background: #e7f4ed; color: #1e6b42; }
.status-partial { background: #fbf5e8; color: #765d31; }
.status-failed { background: #fbecea; color: #9c2f25; }
.status-draft { background: #eef1f3; color: #4e5e68; }
.status-applied { background: #e7f4ed; color: #1e6b42; }
.status-reverted { background: #fff2d9; color: #745016; }
.status-created { background: #eef1f3; color: #4e5e68; }
.status-verified { background: #e7f4ed; color: #1e6b42; }
.status-external_confirmed { background: #e8f1fb; color: #28547a; }
.status-pass { background: #e7f4ed; color: #1e6b42; }
.status-warn { background: #fff2d9; color: #745016; }
.status-fail { background: #f9e7e8; color: #7c3139; }
.extraction-review { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; margin-bottom: 22px; }
.review-pane { min-width: 0; border: 1px solid var(--line); background: white; border-radius: 8px; overflow: hidden; }
.review-pane .panel-heading { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.review-pane iframe { display: block; width: 100%; height: 68vh; border: 0; background: #f7f8f9; }
.extracted-text { height: 68vh; overflow: auto; padding: 16px 18px; background: #fcfcfb; }
.extracted-text section + section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.extracted-text h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.extracted-text pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 Consolas, "Courier New", monospace; color: var(--ink); }
.page-error { margin: 0 0 8px; color: #9c2f25; font-size: 12px; }
.plain-list { margin: 0; padding: 0 22px 18px 38px; color: var(--muted); font-size: 13px; }
.plain-list li { margin: 7px 0; }
.extracted-table { margin: 0 18px 18px; }
.extracted-table caption { text-align: left; padding: 10px 0; color: var(--muted); font-size: 12px; }
.markdown-preview { margin: 0; padding: 18px; max-height: 68vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 Consolas, "Courier New", monospace; color: var(--ink); background: #fcfcfb; border-top: 1px solid var(--line); }
.package-details { max-width: none; padding: 18px; font-size: 12px; }
.package-details p { margin: 0 0 9px; overflow-wrap: anywhere; }
.audit-details { display: block; max-width: 420px; white-space: normal; overflow-wrap: anywhere; font-size: 9px; }
.empty-state { padding: 35px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font: 500 19px Georgia, serif; }
.empty-state p { margin: 7px 0 0; }
.assistant-panel { margin-bottom: 18px; }
.assistant-form { padding: 22px; }
.assistant-form label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.assistant-form textarea { width: 100%; border: 1px solid #c8d1d7; border-radius: 7px; background: white; padding: 12px; color: var(--ink); resize: vertical; }
.assistant-answer pre { margin: 0; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink); background: #fcfcfb; border-top: 1px solid var(--line); }
.assistant-feedback { display: grid; grid-template-columns: 160px minmax(0,1fr) auto; gap: 10px; align-items: end; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfb; }
.assistant-feedback label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.assistant-feedback select, .assistant-feedback input { height: 36px; border: 1px solid #c8d1d7; border-radius: 7px; background: white; padding: 0 10px; color: var(--ink); }
.assistant-history { display: grid; gap: 0; }
.assistant-history article { border-top: 1px solid var(--line-soft); }
.assistant-history header { display: flex; justify-content: space-between; gap: 16px; padding: 16px 18px 8px; }
.assistant-history h3 { margin: 0 0 5px; font: 500 17px Georgia, serif; }
.assistant-history header p { margin: 0; color: var(--muted); font-size: 11px; }
.assistant-history pre { margin: 0; padding: 8px 18px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink); }
.source-list { display: grid; gap: 0; }
.source-list article { display: grid; grid-template-columns: minmax(220px,.9fr) minmax(0,1.4fr); gap: 18px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.source-list h3 { margin: 0 0 5px; font: 500 16px Georgia, serif; }
.source-list p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.source-snippet mark { background: #fff0bf; padding: 0 2px; border-radius: 2px; }
@media (max-width: 1100px) { .operation-actions { grid-template-columns: repeat(2, minmax(0,1fr)); } .batch-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) { .extraction-review { grid-template-columns: 1fr; } .review-pane iframe, .extracted-text { height: 54vh; } }
@media (max-width: 760px) { .split-heading { align-items: flex-start; flex-direction: column; } .operation-actions, .form-grid.two-columns, .batch-summary-grid, .source-list article, .assistant-feedback { grid-template-columns: 1fr; } .form-actions, .batch-actions { align-items: stretch; flex-direction: column; } .form-actions .button, .batch-actions .button { width: 100%; } .credential-row { grid-template-columns: 1fr; } }
