* { box-sizing: border-box; }
:root {
  --bg: #f5f1ea;
  --panel: #fffaf2;
  --ink: #241f1a;
  --muted: #756c62;
  --line: #e2d8ca;
  --brand: #b3261e;
  --brand-dark: #6f1712;
  --gold: #c7a45d;
}
html, body { margin:0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
.shell { min-height:100vh; display:grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top:0; height:100vh; padding:22px; border-right:1px solid var(--line); background:#181410; color:white; }
.brand { display:flex; gap:12px; align-items:center; margin-bottom:28px; }
.brand span { display:block; color:#c8beb3; font-size:.85rem; margin-top:2px; }
.badge { width:44px; height:44px; border-radius:14px; background:var(--brand); display:grid; place-items:center; font-weight:800; }
nav { display:grid; gap:8px; }
nav a { padding:12px 14px; border-radius:14px; color:#f7eee0; }
nav a:hover { background:#2b241e; }
nav a.active { background:#3a2e24; color:#fff8ee; }
.context { margin-top:16px; padding:12px; border:1px solid #3a2f26; border-radius:14px; background:#221a14; }
.context-label { margin:0 0 4px; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:#c8beb3; }

main { padding:24px; max-width:1500px; width:100%; margin:0 auto; }
.hero { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:18px; padding:22px; border-radius:28px; background:linear-gradient(135deg, #211914, #7c211b); color:white; box-shadow:0 14px 40px rgba(20,10,0,.15); }
.hero h1 { margin:.15rem 0; font-size:clamp(1.8rem, 4vw, 3.6rem); line-height:1; max-width:980px; }
.sub { color:rgba(255,255,255,.78); max-width:760px; }
.eyebrow { margin:0; color:var(--gold); text-transform:uppercase; letter-spacing:.12em; font-size:.72rem; font-weight:800; }
.card { background:rgba(255,250,242,.92); border:1px solid var(--line); border-radius:24px; box-shadow:0 10px 30px rgba(45,32,20,.06); }
.filters { display:grid; grid-template-columns: 1fr 220px 220px; gap:12px; padding:14px; margin-bottom:18px; }
input, select, textarea { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:16px; background:white; font:inherit; }
.grid { display:grid; grid-template-columns: 360px 1fr; gap:18px; align-items:start; }
.tree { padding:16px; position:sticky; top:20px; max-height:calc(100vh - 40px); overflow:auto; }
.tree h2 { margin-top:0; }
summary { cursor:pointer; padding:10px; border-radius:12px; font-weight:800; display:flex; justify-content:space-between; }
summary:hover { background:#f0e7d8; }
.nested { margin-left:10px; }
.partlink { display:grid; gap:2px; padding:11px 12px; border-radius:14px; margin:4px 0 4px 16px; background:white; border:1px solid #eee4d5; }
.partlink small { color:var(--muted); }
.cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap:16px; }
.part { padding:18px; }
.part-head { display:flex; justify-content:space-between; gap:10px; align-items:start; }
.part h3 { margin:.25rem 0 1rem; font-size:1.35rem; }
.specs { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin:12px 0; }
.specs span { display:grid; padding:10px; border-radius:14px; background:#f7efe3; }
.specs b { font-size:.72rem; color:var(--muted); text-transform:uppercase; }
.pill { padding:7px 10px; border-radius:999px; background:#e9dfd0; font-weight:800; font-size:.75rem; white-space:nowrap; }
.pill.high, .pill.critical { background:#ffd7d4; color:#8f1811; }
button, .primary, .secondary { border:0; border-radius:16px; padding:12px 15px; font-weight:800; cursor:pointer; display:inline-flex; justify-content:center; }
.primary { background:var(--brand); color:white; }
.secondary { background:#eee2d1; color:#33261a; }
.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.45); display:grid; place-items:center; padding:16px; z-index:10; }
.modal { max-width:920px; width:100%; padding:18px; max-height:90vh; overflow:auto; }
.formgrid { display:grid; grid-template-columns: repeat(3,1fr); gap:12px; }
label { display:grid; gap:6px; color:var(--muted); font-weight:700; }
.actions { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
.tablewrap { overflow:auto; padding:10px; }
table { width:100%; border-collapse: collapse; min-width:760px; }
th, td { text-align:left; padding:12px; border-bottom:1px solid var(--line); }
th { background:#efe4d3; position:sticky; top:0; }
.detail { padding:18px; }
dl { display:grid; grid-template-columns: 180px 1fr; gap:8px 14px; }
dt { color:var(--muted); font-weight:800; }
dd { margin:0; }

@media (max-width: 900px) {
  .shell { display:block; }
  .sidebar { position:relative; height:auto; border-right:0; border-bottom:1px solid #2e251e; }
  nav { grid-template-columns: repeat(3, 1fr); }
  main { padding:14px; }
  .hero { border-radius:22px; flex-direction:column; }
  .filters { grid-template-columns:1fr; }
  .grid { grid-template-columns:1fr; }
  .tree { position:relative; max-height:none; top:auto; }
  .formgrid { grid-template-columns:1fr; }
  dl { grid-template-columns:1fr; }
}
