/* ============================================================
   BOSIA Discovery — Fundação de frontend (sidebar editorial)
   Reuse-First: shell, componentes, estados e tokens do preview.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input[type="submit"], input[type="button"] { min-height: 32px; }
img, svg { max-width: 100%; }
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
::selection { background: var(--brass-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ---------- Shell ---------- */
.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--brand-deep);
  color: #e6efea;
  border-right: 1px solid rgba(0, 0, 0, .18);
}
.sidebar-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.brand-mark {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--brass); color: #251e0f;
  font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand-name { font-family: var(--serif); font-size: 17px; line-height: 1.1; letter-spacing: .01em; color: #fff; }
.brand-sub { display: block; margin-top: 3px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #9dbdb1; }
.sidebar-toggle {
  display: none; margin-left: auto; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2); background: transparent; color: #e6efea;
}
.org-switch {
  margin: 14px 14px 4px; padding: 10px 11px; display: flex; align-items: center; gap: 9px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px;
  background: rgba(255, 255, 255, .055); color: #f1f7f4; text-align: left; width: calc(100% - 28px);
}
.org-switch:hover { background: rgba(255, 255, 255, .09); text-decoration: none; }
.org-avatar {
  width: 28px; height: 28px; display: grid; place-items: center; flex: none;
  border-radius: 7px; background: #d8e7df; color: var(--brand-deep);
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.org-switch .org-name { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.org-switch .org-role { display: block; font-size: 12px; color: #a9c5ba; margin-top: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.nav-section + .nav-section { margin-top: 16px; }
.nav-label {
  padding: 0 10px 7px; font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: #8fb1a5;
}
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 36px;
  padding: 8px 10px; margin: 1px 0; border-radius: 8px;
  color: #c7dbd3; font-size: 13px; text-decoration: none;
  border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active {
  background: rgba(255, 255, 255, .11); color: #fff; font-weight: 600;
  border-left-color: var(--brass);
}
.nav .icon { width: 17px; height: 17px; opacity: .88; flex: none; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--brass); color: #241d0f; font-size: 12px; font-weight: 800;
}
.nav-badge.soft { background: rgba(255,255,255,.16); color: #eaf3ef; }
.project-mini {
  margin: 12px 10px 0; padding: 11px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
}
.project-mini .pm-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #9dbdb1; }
.project-mini .pm-name { display: block; margin: 4px 0 7px; font-size: 12.5px; color: #fff; font-weight: 600; line-height: 1.3; }
.project-mini .progress { background: rgba(255,255,255,.14); height: 5px; }
.project-mini .progress > span { background: var(--brass); }
.project-mini .pm-meta { margin-top: 6px; font-size: 12px; color: #a9c5ba; }
.sidebar-foot {
  padding: 13px 14px; border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-foot .avatar { background: #d7e6de; color: var(--brand-deep); }
.sidebar-foot .u-name { display: block; font-size: 12px; color: #fff; font-weight: 600; line-height: 1.25; }
.sidebar-foot .u-role { display: block; font-size: 12px; color: #a9c5ba; }
.sidebar-foot .icon { margin-left: auto; color: #a9c5ba; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.crumbs { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: var(--line-strong); }
.crumbs .current { color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  width: min(340px, 32vw); height: 36px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--muted); text-align: left; font-size: 12.5px;
}
.top-search:hover { border-color: var(--brand-3); color: var(--ink); }
.top-search kbd {
  margin-left: auto; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg-2); color: var(--muted); font-size: 12px; font-family: var(--sans);
}
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions .preview-badge { margin-right: 4px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-2);
  position: relative;
}
.icon-btn:hover { background: var(--bg-2); border-color: var(--line); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); border: 1.5px solid var(--surface); }
.avatar {
  width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center;
  border-radius: 50%; background: var(--brand-tint); color: var(--brand);
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.avatar.brass { background: var(--brass-tint); color: #6d4b10; }
.avatar.info { background: var(--info-tint); color: var(--info); }
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }

.projectbar { border-bottom: 1px solid var(--line); background: var(--surface-2); padding: 0 28px; }
.projectbar-inner { display: flex; align-items: center; gap: 18px; min-height: 52px; }
.projectbar .project-id { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.projectbar .project-name { font-family: var(--serif); font-size: 15px; color: var(--ink); white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.projectbar .tabs { margin-left: auto; border-bottom: 0; }
.projectbar .tabs .tab { padding: 15px 8px; font-size: 12px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 15px 11px;
  font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brass); font-weight: 650; }

.page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 32px 64px; }
.page.narrow { max-width: 1120px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head-copy { min-width: 0; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-3);
}
.eyebrow .sep { width: 18px; height: 1px; background: var(--brass); display: inline-block; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; color: var(--ink); }
h1 { margin: 0; font-size: 30px; line-height: 1.16; letter-spacing: -.015em; }
h2 { margin: 0; font-size: 21px; line-height: 1.25; }
h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.lede { max-width: 74ch; margin: 7px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.section-title { font-family: var(--serif); font-size: 18px; margin: 0; }
.section-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.grid.gap-16 { gap: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; } .span-9 { grid-column: span 9; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(23, 33, 29, .035), 0 14px 34px -30px rgba(23, 33, 29, .55);
  min-width: 0;
}
.card.flat { box-shadow: none; }
.card.accent { border-top: 3px solid var(--brass); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-head.no-border { border-bottom: 0; padding-bottom: 4px; }
.card-title { font-family: var(--serif); font-size: 16.5px; line-height: 1.25; margin: 0; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-body.pad-sm { padding: 14px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(188px, 1fr)); gap: 16px; }
.kpi {
  position: relative; overflow: hidden; padding: 17px 18px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(23, 33, 29, .03);
}
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line-strong); }
.kpi.ok::before { background: var(--ok); } .kpi.brass::before { background: var(--brass); }
.kpi.warn::before { background: var(--warn); } .kpi.fail::before { background: var(--fail); }
.kpi.info::before { background: var(--info); }
.kpi-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi-value { display: block; margin: 7px 0 3px; font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.kpi-value small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.kpi-delta { font-weight: 700; color: var(--ok); }
.kpi-delta.down { color: var(--fail); }
.kpi-delta.neutral { color: var(--muted); }
.kpi-spark { margin-top: 8px; height: 26px; }
.kpi-spark svg { width: 100%; height: 26px; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 13px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 650; line-height: 1;
  text-decoration: none; white-space: nowrap; transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 15px; height: 15px; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--brand-3); color: var(--brand); }
.btn.soft { background: var(--brand-tint); color: var(--brand); }
.btn.soft:hover { background: #d8e8df; }
.btn.brass { background: var(--brass); color: #241d0f; }
.btn.brass:hover { background: #c69a4f; }
.btn.danger { background: var(--fail); color: #fff; }
.btn.danger-soft { background: var(--danger-tint); color: var(--fail); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { min-height: 42px; padding: 0 18px; font-size: 13.5px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.icon-only.sm { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.link { color: var(--brand); font-weight: 600; font-size: 12.5px; }
.link.muted { color: var(--muted); font-weight: 500; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.field .req { color: var(--fail); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-size: 13px; line-height: 1.4; transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 79, 67, .12); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-2); color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error-text { font-size: 12px; color: var(--fail); font-weight: 600; }
.input.invalid { border-color: var(--fail); box-shadow: 0 0 0 3px rgba(159, 58, 52, .10); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.radio-card { display: flex; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); cursor: pointer; }
.radio-card:hover { border-color: var(--brand-3); }
.radio-card.selected { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.radio-card .rc-title { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.radio-card .rc-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.radio-card .icon { width: 19px; height: 19px; color: var(--brand); flex: none; }

/* ---------- Filter bar & tabs ---------- */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 18px; }
.toolbar .grow { flex: 1; }
.toolbar .search { position: relative; min-width: 220px; flex: 0 1 320px; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.toolbar .search .input { padding-left: 34px; background: var(--surface); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 12px; }
.filter-chip:hover { border-color: var(--brand-3); color: var(--brand); text-decoration: none; }
.filter-chip.strong { background: var(--brand-tint); border-color: var(--brand-3); color: var(--brand); }
.filter-chip .x { color: var(--muted); font-size: 14px; line-height: 1; }
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.seg button, .seg a { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; }
.seg button.active, .seg a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 33, 29, .12); }
.tabs.scroll { border-bottom: 1px solid var(--line); }
.tabs.scroll .tab { padding: 11px 13px; }
.tabs.scroll .tab.active { border-bottom-color: var(--brand); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: inherit; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data th {
  position: sticky; top: 0; z-index: 1; padding: 10px 14px; text-align: left;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data tbody tr:hover td { background: var(--surface-2); }
.data tbody tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .center { text-align: center; }
.data .strong { font-weight: 650; color: var(--ink); }
.data .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.data .actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.data a.link, .data .link { white-space: nowrap; }
.data .row-link { color: var(--ink); font-weight: 650; }
.data .row-link:hover { color: var(--brand); text-decoration: none; }
.data.compact td { padding: 8px 12px; }
.data.compact th { padding: 8px 12px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager a, .pager span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); font-size: 12px; text-decoration: none; }
.pager .active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Badges, chips & status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 21px; padding: 1px 8px;
  border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 700;
  line-height: 1.4; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--brand-tint); color: var(--brand); border-color: #cfe2d9; }
.badge.brass { background: var(--brass-tint); color: #7c5717; border-color: #ead7b5; }
.badge.warn { background: var(--warn-tint); color: var(--warn); border-color: #ead6b8; }
.badge.fail { background: var(--danger-tint); color: var(--fail); border-color: #efd1cd; }
.badge.info { background: var(--info-tint); color: var(--info); border-color: #d1ddeb; }
.badge.muted { background: var(--bg-2); color: var(--muted); border-color: var(--line); }
.badge.ai { background: #eee9f7; color: #5b4a82; border-color: #ddd4ee; }
.badge.outline { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px;
}
.chip .chip-dot { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 800; flex: none; }
.chip .x { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.classification { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.classification .lock { width: 11px; height: 11px; }
.priority { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.priority .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--line-strong); }
.priority.critical .bar { background: var(--fail); } .priority.high .bar { background: var(--warn); }
.priority.medium .bar { background: var(--brass); } .priority.low .bar { background: var(--ok); }

/* ---------- Progress & meters ---------- */
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.progress.brass > span { background: var(--brass); }
.progress.warn > span { background: var(--warn); }
.progress.fail > span { background: var(--fail); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; min-width: 80px; }
.progress-row .pct { width: 34px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.meter { display: flex; gap: 6px; align-items: center; }
.meter .seg { padding: 0; background: transparent; border: 0; gap: 3px; }
.meter .tick { width: 20px; height: 8px; border-radius: 2px; background: var(--bg-2); }
.meter .tick.on { background: var(--brand); }
.meter .tick.target { background: var(--brass); opacity: .6; }

/* ---------- Charts ---------- */
.chart-card { padding: 0; }
.chart-wrap { padding: 14px 16px 8px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart-svg .axis-text { fill: var(--muted); font-family: var(--sans); font-size: 12px; }
.chart-svg .axis-text.strong { fill: var(--ink-2); font-weight: 600; }
.chart-svg .line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line.dashed { stroke-dasharray: 5 5; stroke-width: 2; }
.chart-svg .area { opacity: .15; }
.chart-svg .dot { stroke: #fff; stroke-width: 1.5; }
.chart-svg .bar { rx: 3; }
.chart-svg .bar.soft { opacity: .75; }
.chart-svg .axis-line { stroke: var(--line-strong); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 16px 14px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 10px; font-size: 12px; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 16px 16px; }
.donut-svg { width: 148px; height: 148px; flex: none; }
.donut-center-value { font-family: var(--serif); font-size: 25px; fill: var(--ink); }
.donut-center-label { font-family: var(--sans); font-size: 12px; fill: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.donut-legend { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 7px; }
.donut-legend .row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.donut-legend .row .val { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Lists, timelines & details ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-title { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.list-row .lr-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.list-row .lr-side { margin-left: auto; text-align: right; white-space: nowrap; }
.list-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--bg-2); color: var(--brand); }
.list-icon .icon { width: 15px; height: 15px; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 5px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -19px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-3); }
.timeline-item.brass::before { border-color: var(--brass); }
.timeline-item.fail::before { border-color: var(--fail); }
.timeline-item .t-time { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.timeline-item .t-title { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.timeline-item .t-desc { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Phases / stepper ---------- */
.phase-list { display: flex; flex-direction: column; }
.phase-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.phase-item:last-child { border-bottom: 0; }
.phase-item:first-child { padding-top: 0; }
.phase-dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
.phase-item.done .phase-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.phase-item.current .phase-dot { background: var(--brass); border-color: var(--brass); color: #241d0f; }
.phase-title { display: block; font-size: 13px; font-weight: 650; color: var(--ink); }
.phase-desc { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.phase-criteria { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.phase-side { text-align: right; font-size: 12px; color: var(--muted); }
.stepper { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0 0 22px; }
.step { padding: 10px 10px 9px; border-top: 3px solid var(--line); background: var(--surface); border-radius: 0 0 7px 7px; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.step .step-n { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.step .step-t { display: block; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.step.done { border-top-color: var(--brand); } .step.done .step-t { color: var(--ink-2); }
.step.current { border-top-color: var(--brass); background: var(--brass-tint); } .step.current .step-t { color: var(--ink); }
.step.current .step-n { color: #7c5717; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: var(--bg); }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 42px 48px; background: var(--brand-deep); color: #e9f2ee; }
.auth-aside::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 82% 18%, rgba(181,138,63,.20), transparent 36%), radial-gradient(circle at 12% 86%, rgba(47,118,97,.42), transparent 44%); pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { border: 0; padding: 0; }
.auth-aside .brand-name { color: #fff; }
.auth-aside .brand-sub { color: #a9c5ba; }
.auth-pitch { max-width: 520px; margin: auto 0; padding: 44px 0; }
.auth-pitch .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #d6b877; }
.auth-pitch h2 { margin: 16px 0 14px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; color: #fff; letter-spacing: -.02em; }
.auth-pitch p { margin: 0; max-width: 46ch; font-size: 13.5px; line-height: 1.7; color: #b9cec5; }
.auth-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.12); }
.auth-proof div { padding: 13px 14px; background: rgba(12,59,51,.72); }
.auth-proof b { display: block; font-family: var(--serif); font-size: 22px; color: #fff; line-height: 1; }
.auth-proof span { display: block; margin-top: 4px; font-size: 12px; color: #a9c5ba; }
.auth-aside .auth-foot { font-size: 12px; color: #8fb1a5; display: flex; justify-content: space-between; gap: 16px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 36px 28px; }
.auth-card { width: min(440px, 100%); }
.auth-card .auth-title { margin: 0 0 6px; font-family: var(--serif); font-size: 30px; line-height: 1.15; }
.auth-card .auth-sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.auth-card .card { padding: 26px; }
.auth-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.field-control { position: relative; }
.field-control .input { padding-right: 46px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 30px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: var(--muted); min-height: 0;
}
.password-toggle:hover { color: var(--brand); background: var(--bg-2); border-color: var(--line); }
.password-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.password-toggle.is-revealing { color: var(--brand); }
.password-toggle .icon { width: 17px; height: 17px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.security-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.security-note .icon { width: 14px; height: 14px; color: var(--brand); flex: none; margin-top: 1px; }

/* ---------- Notices, states & empty ---------- */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.notice .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--brand); }
.notice.warn { background: var(--warn-tint); border-color: #ecd5b2; color: #6e470f; }
.notice.warn .icon { color: var(--warn); }
.notice.fail { background: var(--danger-tint); border-color: #eacbc7; color: #7d2a26; }
.notice.fail .icon { color: var(--fail); }
.notice.info { background: var(--info-tint); border-color: #d2ddea; color: #294b68; }
.notice.info .icon { color: var(--info); }
.notice.ai { background: #f1edf8; border-color: #ddd4ee; color: #4e3f70; }
.notice.ai .icon { color: #6d589a; }
.notice .nc-title { display: block; font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.state { padding: 46px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.state-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); margin-bottom: 4px; }
.state-icon.warn { background: var(--warn-tint); color: var(--warn); }
.state-icon.fail { background: var(--danger-tint); color: var(--fail); }
.state-icon.info { background: var(--info-tint); color: var(--info); }
.state-icon .icon { width: 25px; height: 25px; }
.state h2 { font-size: 22px; }
.state p { max-width: 52ch; margin: 0; color: var(--muted); font-size: 12.5px; }
.state .state-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.state-code { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--line-strong); letter-spacing: -.03em; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty .icon { width: 30px; height: 30px; color: var(--line-strong); margin-bottom: 8px; }

/* ---------- Side panel / drawer / misc ---------- */
.side-panel { position: sticky; top: 84px; }
.panel-section + .panel-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.panel-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.key-value { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 12px; }
.key-value dt { color: var(--muted); }
.key-value dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
dl.key-values { margin: 0; }
.callout { border-left: 3px solid var(--brass); padding: 8px 0 8px 13px; color: var(--ink-2); font-size: 12px; background: linear-gradient(90deg, var(--brass-tint), transparent 70%); border-radius: 0 7px 7px 0; }
.score { display: inline-flex; align-items: baseline; gap: 3px; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.score small { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.rank { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--bg-2); color: var(--muted); font-size: 12px; font-weight: 800; }
.rank.top { background: var(--brass-tint); color: #7c5717; }
.risk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.risk .dot { width: 7px; height: 7px; border-radius: 50%; }
.risk.low .dot { background: var(--ok); } .risk.medium .dot { background: var(--brass); } .risk.high .dot { background: var(--fail); }
.diff { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.diff-line { display: flex; gap: 10px; padding: 3px 12px; white-space: pre-wrap; }
.diff-line .ln { width: 22px; flex: none; color: var(--muted-2); text-align: right; }
.diff-line.add { background: #e9f3ed; color: #245c40; }
.diff-line.rem { background: #f9eae8; color: #8a302b; }
.diff-line.head { background: var(--panel-2); color: var(--muted); font-weight: 700; }
.code-inline { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.sla { font-variant-numeric: tabular-nums; font-weight: 650; }
.sla.late { color: var(--fail); } .sla.soon { color: var(--warn); }
.file-drop { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 24px; text-align: center; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.file-drop .icon { width: 24px; height: 24px; color: var(--brand-3); margin-bottom: 6px; }
.quote { margin: 0; padding: 13px 15px; border-left: 2px solid var(--brass); background: var(--surface-2); color: var(--ink-2); font-family: var(--serif); font-size: 14px; line-height: 1.6; border-radius: 0 8px 8px 0; }
.hr { height: 1px; background: var(--line-soft); border: 0; margin: 16px 0; }
.hr.strong { background: var(--line); }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { width: 25px; height: 25px; font-size: 12px; border: 2px solid var(--surface); margin-left: -7px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more { width: 25px; height: 25px; border-radius: 50%; background: var(--bg-2); color: var(--muted); display: grid; place-items: center; font-size: 12px; margin-left: -7px; border: 2px solid var(--surface); }
.link-list { display: flex; flex-direction: column; gap: 0; }
.link-list a { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12px; text-decoration: none; }
.link-list a:last-child { border-bottom: 0; }
.link-list a:hover { color: var(--brand); }
.link-list .icon { width: 14px; height: 14px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.four-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.matrix-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.gantt { width: 100%; overflow-x: auto; }
.gantt-grid { min-width: 760px; display: grid; grid-template-columns: 190px repeat(12, minmax(0, 1fr)); row-gap: 8px; align-items: center; }
.gantt-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); text-align: center; }
.gantt-label { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { grid-column: 2 / -1; position: relative; height: 27px; background: repeating-linear-gradient(90deg, transparent, transparent calc(8.333% - 1px), var(--line-soft) calc(8.333% - 1px), var(--line-soft) 8.333%); border-radius: 5px; }
.gantt-bar { position: absolute; top: 4px; height: 19px; border-radius: 5px; background: var(--brand); color: #fff; font-size: 12px; display: flex; align-items: center; padding: 0 7px; white-space: nowrap; overflow: hidden; }
.gantt-bar.brass { background: var(--brass); color: #2b220f; }
.gantt-bar.info { background: var(--info); }
.gantt-bar.soft { background: var(--brand-3); }
.gantt-milestone { position: absolute; top: 1px; width: 2px; height: 25px; background: var(--brass); border-radius: 2px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kanban-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 9px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.kanban-card:last-child { margin-bottom: 0; }
.kanban-card .kc-title { font-size: 12px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.kanban-card .kc-meta { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }

/* ---------- Modal, palette & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; padding: 11vh 18px 18px; background: rgba(12, 30, 25, .46); backdrop-filter: blur(2px); }
.modal.open { display: flex; align-items: flex-start; justify-content: center; }
.palette { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 28px 80px -30px rgba(0,0,0,.5); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.palette-search .icon { width: 18px; height: 18px; color: var(--muted); }
.palette-search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 14px; }
.palette-group { padding: 8px 8px 0; }
.palette-label { padding: 4px 8px 5px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; color: var(--ink-2); font-size: 12.5px; }
.palette-item:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.palette-item .icon { width: 15px; height: 15px; color: var(--muted); }
.palette-item kbd { margin-left: auto; font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 1px 4px; border-radius: 3px; }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--muted); }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 90; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  background: var(--brand-deep); color: #edf6f1; border-radius: 9px;
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.55); font-size: 12px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .icon { width: 16px; height: 16px; color: #d6b877; flex: none; margin-top: 1px; }
.toast b { display: block; font-size: 12px; margin-bottom: 1px; }
.toast span { color: #b9cec5; }

/* ---------- Print / report ---------- */
.report-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 42px 46px; max-width: 960px; margin: 0 auto; }
.report-sheet h1 { font-size: 30px; }
.report-kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); font-weight: 800; }
.report-meta { display: flex; flex-wrap: wrap; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0 24px; font-size: 12px; color: var(--muted); }
.report-meta b { color: var(--ink-2); }
.report-sheet h2 { margin: 26px 0 8px; font-size: 20px; }
.report-sheet h3 { margin: 18px 0 6px; }
.report-sheet p { font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.report-sheet .confidential { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media print {
  .sidebar, .topbar, .projectbar, .page-actions, .toolbar, .modal, .toast, .snapshot-top, .snapshot-index { display: none !important; }
  .app { display: block; }
  .page { max-width: none; padding: 0; }
  .report-sheet { border: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; }
}

/* ---------- Snapshot (preview visual) ---------- */
.snapshot { background: var(--bg); }
.snapshot-top {
  position: sticky; top: 0; z-index: 60; height: 60px;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.snapshot-top .brand { border: 0; padding: 0; }
.snapshot-top .brand-name { color: var(--ink); }
.snapshot-top .brand-sub { color: var(--muted); }
.snapshot-title { font-size: 12px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.snapshot-title b { color: var(--ink); font-weight: 650; }
.snapshot-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.snapshot-wrap { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 28px; max-width: 1680px; margin: 0 auto; padding: 24px 26px 60px; }
.snapshot-index { position: static; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.idx-details > summary { display: none; }
.idx-details > .idx-body { display: block; }
.idx-summary-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.idx-chev { margin-left: auto; color: var(--muted); font-size: 16px; line-height: 1; }
.idx-details[open] > summary .idx-chev::after { content: '−'; }
.idx-details:not([open]) > summary .idx-chev::after { content: '+'; }
.snapshot-index .idx-title { font-family: var(--serif); font-size: 17px; margin: 0 0 3px; }
.snapshot-index .idx-sub { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.idx-group + .idx-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.idx-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-bottom: 5px; }
.idx-links { display: flex; flex-direction: column; gap: 1px; }
.idx-links a { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 5px; color: var(--ink-2); font-size: 12px; text-decoration: none; }
.idx-links a:hover { background: var(--bg-2); color: var(--brand); }
.idx-links .id { width: 22px; flex: none; font-size: 12px; font-weight: 800; color: var(--muted); }
.snapshot-main { min-width: 0; }
.snapshot-intro { margin: 0 0 26px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.snapshot-intro h1 { font-size: 28px; }
.snapshot-intro p { max-width: 90ch; margin: 7px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.snapshot-intro .legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.snapshot-intro .legend span { display: inline-flex; align-items: center; gap: 6px; }
.snapshot-intro .legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.snapshot-screen { margin: 0 0 30px; scroll-margin-top: 78px; }
.snapshot-label { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.snapshot-label .sid { display: inline-grid; place-items: center; min-width: 31px; height: 21px; padding: 0 6px; border-radius: 5px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; }
.snapshot-label .sname { font-family: var(--serif); font-size: 14px; color: var(--ink); font-weight: 600; }
.snapshot-label .sroute { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted-2); }
.snapshot-label .sdesc { margin-left: auto; max-width: 48ch; text-align: right; font-size: 12px; }
.snapshot-frame { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--bg); box-shadow: 0 22px 50px -38px rgba(23,33,29,.65); }
.snapshot-frame .app { min-height: 0; }
.snapshot .sidebar { position: static; height: auto; align-self: stretch; }
.snapshot .topbar { position: static; }
.snapshot .side-panel { position: static; }
.snapshot .auth { min-height: 620px; }
.snapshot .auth-aside { min-height: 620px; }
.snapshot-frame .page { padding-bottom: 34px; }
.snapshot-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 12px; color: var(--muted); }
.snapshot-note .icon { width: 12px; height: 12px; flex: none; margin-top: 1px; }
.snapshot-intro .token-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.snapshot-intro .token { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); }
.snapshot-intro .token i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(23,33,29,.12); flex: none; }
.snapshot-intro .kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.snapshot-intro .kit-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-right: 2px; }

/* ---------- Premium polish & state layer ---------- */
:root { --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); --ease-out: cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
h1, h2, h3, .card-title, .section-title { text-wrap: balance; }
.lede, .card-sub, .state p, .empty, .notice { text-wrap: pretty; }
.num, .pct, .kpi-value, .score, .val, .progress-row .pct, .data .num, .sla { font-variant-numeric: tabular-nums; }
.btn, .icon-btn, .filter-chip, .tab, .nav a, .seg button, .seg a, .pager a, .input, .select, .textarea {
  transition-timing-function: var(--ease-out);
}
.btn:focus-visible, .icon-btn:focus-visible, .filter-chip:focus-visible, .tab:focus-visible,
.seg button:focus-visible, .seg a:focus-visible, .pager a:focus-visible, .nav a:focus-visible {
  outline: none; box-shadow: var(--ring);
}
.filter-chip.strong { font-weight: 650; }
.data tbody tr:focus-within td { background: var(--surface-2); }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar { height: 9px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--surface); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.spinner {
  width: 15px; height: 15px; display: inline-block; flex: none; vertical-align: -2px;
  border: 2px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-top-color: var(--brand); border-radius: 50%; animation: bosia-spin .7s linear infinite;
}
.btn .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.btn.ghost .spinner, .btn.soft .spinner { border-color: color-mix(in srgb, var(--brand) 20%, transparent); border-top-color: var(--brand); }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: bosia-spin .7s linear infinite;
}
.btn.ghost.loading::after, .btn.soft.loading::after { border-color: color-mix(in srgb, var(--brand) 20%, transparent); border-top-color: var(--brand); }
@keyframes bosia-spin { to { transform: rotate(360deg); } }
.skeleton { position: relative; overflow: hidden; border-radius: 6px; background: var(--bg-2); color: transparent !important; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 62%, transparent), transparent); animation: skeleton-sweep 1.5s infinite; }
@keyframes skeleton-sweep { 100% { transform: translateX(100%); } }
.skeleton-line { height: 9px; margin: 7px 0; border-radius: 999px; }
.skeleton-line.w-30 { width: 30%; } .skeleton-line.w-50 { width: 50%; } .skeleton-line.w-70 { width: 70%; }
.state.loading .state-icon .icon { animation: bosia-pulse 1.2s ease-in-out infinite; }
@keyframes bosia-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.filter-empty td { padding: 26px 16px !important; text-align: center; color: var(--muted); font-size: 12px; background: var(--surface-2) !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
  .app { grid-template-columns: 224px minmax(0, 1fr); }
  .page { padding: 24px 24px 54px; }
  .topbar { padding: 0 22px; }
  .projectbar { padding: 0 22px; }
  .span-8, .span-7, .span-9 { grid-column: span 12; }
  .span-5, .span-4, .span-3 { grid-column: span 6; }
  .four-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { display: block; }
  .top-actions .preview-badge { display: none; }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 40; }
  .sidebar-body { display: none; }
  .sidebar.is-open .sidebar-body { display: flex; }
  .sidebar-toggle { display: inline-grid; place-items: center; }
  .sidebar .brand { padding: 12px 16px; }
  .sidebar .nav { max-height: 50vh; }
  .topbar { position: static; height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .top-search { width: 100%; margin-left: 0; order: 3; }
  .crumbs { flex: 1; }
  .projectbar { padding: 0 16px; }
  .projectbar-inner { flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .projectbar .tabs { margin-left: 0; width: 100%; }
  .page { padding: 20px 16px 48px; }
  .page-head { flex-direction: column; gap: 14px; }
  .page-actions { justify-content: flex-start; width: 100%; }
  .grid { gap: 14px; }
  .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; }
  .two-col, .three-col, .four-col, .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .snapshot-index { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { min-height: 300px; padding: 28px 24px; }
  .auth-pitch { padding: 28px 0; }
  .auth-pitch h2 { font-size: 28px; }
  .auth-proof { grid-template-columns: repeat(3, 1fr); }
  .auth-main { padding: 28px 18px; }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stepper .step:nth-child(n+5) { display: none; }
  .snapshot-wrap { grid-template-columns: 1fr; padding: 16px 14px 44px; }
  .snapshot-index { max-height: none; overflow: visible; padding: 10px 12px; }
  .idx-details > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
  .idx-details > summary::-webkit-details-marker { display: none; }
  .idx-details:not([open]) > .idx-body { display: none; }
  .idx-details[open] > .idx-body { padding-top: 12px; }
  .idx-details .idx-title, .idx-details .idx-sub { display: none; }
  .idx-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; }
  .snapshot .sidebar { position: static; }
  .snapshot .topbar { position: static; flex-wrap: wrap; }
  .snapshot .top-search { width: auto; }
  .snapshot .auth { min-height: 0; }
  .snapshot .auth-aside { min-height: 300px; }
  .report-sheet { padding: 26px 20px; }
}
@media (max-width: 620px) {
  h1 { font-size: 25px; }
  .page-head { margin-bottom: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi-value { font-size: 25px; }
  .kpi-foot { flex-direction: column; align-items: flex-start; gap: 3px; }
  .toolbar { gap: 7px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .filter-chip { font-size: 12px; padding: 0 9px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .card-body.tight { padding: 0; }
  .data th, .data td { padding: 9px 10px; }
  .snapshot-label { flex-wrap: wrap; }
  .snapshot-label .sdesc { display: none; }
  .snapshot-title { display: none; }
  .snapshot-meta .badge { display: none; }
  .idx-links { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stepper .step:nth-child(n+4) { display: none; }
  .auth-aside { min-height: 260px; padding: 22px 18px; }
  .auth-pitch h2 { font-size: 25px; }
  .auth-card .card { padding: 18px; }
  .report-sheet { padding: 20px 14px; }
  .report-sheet h1 { font-size: 24px; }
  .gantt-grid { min-width: 620px; grid-template-columns: 150px repeat(12, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-foot { flex-direction: row; align-items: center; }
  .page { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .projectbar { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Acesso, sessão e estados de segurança (sprint 1) ---------- */
[hidden] { display: none !important; }
.notice.ok { background: var(--brand-tint); border-color: #cfe2d9; color: #1d5344; }
.notice.ok .icon { color: var(--brand); }
.sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.small { font-size: 12px; line-height: 1.55; }

.btn-spinner {
  display: none; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: bosia-spin .7s linear infinite;
}
.btn.is-busy .btn-spinner { display: inline-block; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn-label { opacity: .82; }
@keyframes bosia-spin { to { transform: rotate(360deg); } }

.sidebar-logout {
  margin-left: 6px; width: 30px; height: 30px; display: inline-grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px;
  background: transparent; color: #cfe0d8; flex: none;
}
.sidebar-logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar-logout .icon { width: 14px; height: 14px; margin: 0; color: inherit; }
.sidebar-logout span { display: none; }

.auth-card #login-already { margin-bottom: 14px; }
.auth-card #login-already .btn { margin-top: 10px; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }

body.session-cleared .main,
body.session-cleared .sidebar,
body.session-cleared .topbar { visibility: hidden; }
body.access-state .projectbar,
body.access-state .project-mini { display: none !important; }
.app.access-state { grid-template-columns: minmax(0, 1fr) !important; }
.app.access-state .main { min-height: 100vh; }
.app.access-state .page { max-width: 1120px; }
/* Estados públicos de 403/404 nunca deixam o shell autenticado visível,
   mesmo antes da hidratação do JavaScript. */
body[data-bosia-auth="anonymous"] .sidebar,
body[data-bosia-auth="anonymous"] .topbar { display: none !important; }
body[data-bosia-auth="anonymous"] .app { grid-template-columns: minmax(0, 1fr); }
body[data-bosia-auth="anonymous"] .main { min-height: 100vh; }
body[data-bosia-auth="anonymous"] .page { max-width: 1120px; }
/* 403/404 genéricos: nenhuma identidade, organização ou contexto de projeto
   do produto é exibida, mesmo que a rota tenha sido aberta por link profundo. */
body.access-state .sidebar,
body.access-state .topbar { display: none !important; }
body.access-state .app { grid-template-columns: minmax(0, 1fr); }
body.access-state .main { min-height: 100vh; }
body.access-state .page { max-width: 1120px; }
.session-cleared-notice {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 24px; background: var(--bg);
}
.session-cleared-card {
  width: min(420px, 100%); padding: 30px; text-align: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md, 0 18px 40px rgba(23,33,29,.12));
}
.session-cleared-card h1 { margin: 14px 0 8px; font-family: var(--serif); font-size: 28px; }
.session-cleared-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 720px) {
  .auth-main { padding: 24px 16px; }
  .auth-card .auth-title { font-size: 26px; }
}
.sidebar-foot > div { min-width: 0; }
.sidebar-foot .u-name, .sidebar-foot .u-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Perfil: estados reais de organizações e sessões (sprint 1) */
.empty .muted { margin-top: 4px; font-size: 12px; }
.data tbody td .empty { padding: 18px 10px; }
.profile-sessions-loading .skeleton-line { display: block; }
.profile-sessions-empty td { background: var(--surface-2); }
#profile-orgs .empty { padding: 22px 12px; }
#profile-orgs .empty:only-child { border: 1px dashed var(--line); border-radius: var(--radius); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--fail); box-shadow: 0 0 0 2px var(--danger-tint); }
#change-password, #admin-create-user { margin-top: 16px; }
#change-password-status, #admin-user-status { font-size: 12px !important; }
.empty .btn { margin-top: 10px; }

/* Sprint 1 — garantias de acessibilidade e alvo de toque */
button, [role="button"], .btn, .icon-btn, .filter-chip, .seg button, .seg a,
.pager a, .pager span, .sidebar-logout, .sidebar-toggle, .top-search, .org-switch {
  min-height: 32px;
}
.sidebar-logout { width: 32px; height: 32px; }
[style*="font-size:10"], [style*="font-size: 10"],
[style*="font-size:11"], [style*="font-size: 11"] { font-size: 12px !important; }
kbd, small, .small { font-size: 12px; }
.auth-main .muted, .auth-main .small, .auth-main .sub, .auth-main .hint,
.auth-main .table-foot, .auth-main .security-note, .auth-main .divider,
.auth-main .badge { font-size: 12px; }
.auth-main [style*="font-size:11"], .auth-main [style*="font-size: 11"] { font-size: 12px !important; }
.auth-main code, .auth-main .mono { font-size: 12px; }
.profile-sessions-empty td .empty { text-align: left; align-items: flex-start; }
#profile-sessions-count { white-space: nowrap; }

/* Sprint 1 — sem overflow horizontal em telas estreitas */
.card-head { flex-wrap: wrap; row-gap: 8px; }
.card-head > div { min-width: 0; }
.card-head .flex { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 620px) {
  .page-head-copy, .page-head { min-width: 0; }
  .form-grid, .two-col, .three-col { min-width: 0; }
}

.auth-assurance { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 18px; }
.auth-assurance .assurance { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.auth-assurance .assurance .icon { width: 13px; height: 13px; color: var(--brand); }
.auth-policy { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.auth-policy span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.auth-policy b { display: block; color: var(--ink-2); font-size: 12px; letter-spacing: .02em; }

.stepper-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; list-style: none; }
.stepper-3 .step { list-style: none; }

.requirements { list-style: none; display: flex; flex-direction: column; gap: 5px; margin: 2px 0 0; padding: 0; }
.requirements li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.requirements li .icon { width: 13px; height: 13px; color: var(--line-strong); }
.requirements li.ok { color: var(--brand); }
.requirements li.ok .icon { color: var(--brand); }
.requirements li.pending .icon { color: var(--line-strong); }

.avatar.has-image { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }

.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.security-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.security-item > .icon { width: 18px; height: 18px; color: var(--brand); flex: none; margin-top: 1px; }
.security-item b { display: block; font-size: 12.5px; color: var(--ink); }
.security-item span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.confirm-dialog { width: min(520px, 100%); }
.confirm-dialog .card-head { padding: 18px 20px 0; }
.confirm-dialog .card-body { padding: 14px 20px 20px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .security-grid { grid-template-columns: 1fr; }
  .auth-policy { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .stepper-3 { grid-template-columns: 1fr; }
  .stepper-3 .step { display: block; }
}

/* ---------- Sprint 6 — organizações, membros, papéis e classificação ---------- */
.perm-intersection {
  display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap;
}
.perm-intersection.compact { gap: 6px; }
.perm-node {
  flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
}
.perm-node b { font-size: 12.5px; color: var(--ink); }
.perm-node > span:not(.perm-icon) { font-size: 12px; color: var(--muted); line-height: 1.45; }
.perm-node.result { background: var(--brand-tint); border-color: #cfe2d9; }
.perm-icon {
  width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 3px;
  border-radius: 8px; background: var(--surface); color: var(--brand); border: 1px solid var(--line-soft);
}
.perm-icon .icon { width: 15px; height: 15px; }
.perm-op { align-self: center; font-family: var(--serif); font-size: 20px; color: var(--brass); }
.role-scope-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.role-scope-row:last-child { border-bottom: 0; }
.role-scope-row > div { min-width: 0; flex: 1; }
.role-scope-row b { display: block; font-size: 12.5px; color: var(--ink); }
.classification-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.classification-legend .classification { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); }
.classification-row {
  display: grid; grid-template-columns: minmax(92px, auto) 1fr auto; align-items: center;
  gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--muted);
}
.classification-row:last-child { border-bottom: 0; }
.classification-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.role-matrix td { vertical-align: top; white-space: normal; }
.role-matrix td:first-child { min-width: 176px; }
.role-matrix td:nth-child(2) { min-width: 118px; color: var(--muted); }
.perm-yes, .perm-no, .perm-partial {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; line-height: 1.35;
}
.perm-yes { color: var(--ok); }
.perm-no { color: var(--muted-2); font-weight: 550; }
.perm-partial { color: #7c5717; }
.classification-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.classification-card {
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.classification-card > b { display: block; margin: 10px 0 5px; font-size: 13px; color: var(--ink); }
.classification-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.classification-effects { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.classification-effects span { font-size: 12px; color: var(--ink-2); }
.classification-effects span::before { content: '·'; color: var(--brass); margin-right: 6px; font-weight: 800; }
button.link { background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: var(--brand); font-weight: 600; font-size: 12.5px; }
button.link.muted { color: var(--muted); font-weight: 500; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.modal .confirm-dialog { max-height: 88vh; overflow: auto; }
.modal .confirm-dialog .card-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.btn-spinner { display: none; }
.btn.is-busy .btn-spinner { display: inline-block; }
@media (max-width: 980px) {
  .classification-grid { grid-template-columns: 1fr; }
  .perm-node { flex-basis: 100%; }
  .perm-op { display: none; }
}
.field .error-text.ok { color: var(--ok); }
body[data-org-manage="false"] [data-org-create-open],
body[data-org-manage="false"] [data-member-invite-open],
body[data-org-manage="false"] [data-member-manage],
body[data-org-manage="false"] [data-policy-save],
body[data-org-manage="false"] #policy-save-top,
body[data-org-manage="false"] [data-training-open],
body[data-org-manage="false"] [data-training-revoke],
body[data-org-manage="false"] [data-members-export],
body[data-org-manage="false"] [data-org-export] { display: none !important; }
.role-scope-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
