body { font-family: system-ui, -apple-system, Segoe UI, sans-serif; margin: 0; background: #f6f7f9; color: #172033; }
header { background:#111827; color:#fff; padding: 14px 22px; display:flex; justify-content:space-between; align-items:center; }
header a { color:#fff; margin-right:16px; text-decoration:none; }
header form { display:inline; }
main { max-width: 1120px; margin: 28px auto; padding: 0 18px; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:20px; margin-bottom:18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap:16px; }
label { display:block; font-weight:600; margin:12px 0 6px; }
input, textarea, select { width:100%; box-sizing:border-box; padding:10px; border:1px solid #cfd5df; border-radius:8px; font:inherit; }
textarea { min-height:100px; }
button, .button { background:#111827; color:#fff; border:none; padding:10px 14px; border-radius:8px; cursor:pointer; text-decoration:none; display:inline-block; }
button[disabled] { opacity:.55; cursor:not-allowed; }
.muted { color:#6b7280; font-size:.92rem; }
.error { color:#991b1b; background:#fee2e2; border:1px solid #fecaca; padding:10px; border-radius:8px; }
.success { color:#14532d; background:#dcfce7; border:1px solid #bbf7d0; padding:10px; border-radius:8px; }
table { width:100%; border-collapse:collapse; }
th, td { padding:9px; border-bottom:1px solid #e5e7eb; text-align:left; vertical-align:top; }
code { background:#eef2f7; padding:2px 5px; border-radius:5px; word-break: break-all; }
.danger { color:#991b1b; font-weight:700; }
.notice { background:#eff6ff; border:1px solid #bfdbfe; padding:12px; border-radius:8px; }
.small { font-size:.85rem; }

.button.danger,button.danger{background:#9b0000;color:#fff}.inline{display:inline-block;margin-left:8px}select{padding:6px;margin:4px 0}

/* v3 portal polish */
.topbar { background: linear-gradient(90deg,#0f172a,#1e293b); color:#fff; padding: 14px 22px; display:flex; justify-content:space-between; align-items:center; gap:18px; box-shadow:0 2px 14px rgba(15,23,42,.25); }
.topbar.client { background: linear-gradient(90deg,#064e3b,#0f766e); }
.brand a { display:flex; flex-direction:column; gap:2px; color:#fff; text-decoration:none; }
.brand span { font-size:.78rem; color:#cbd5e1; font-weight:500; }
.hero { background:linear-gradient(135deg,#ffffff,#eef6ff); border:1px solid #dbeafe; border-radius:18px; padding:24px; margin-bottom:18px; display:flex; justify-content:space-between; gap:18px; align-items:center; box-shadow:0 8px 24px rgba(15,23,42,.05); }
.hero h1 { margin:0 0 8px; font-size:2rem; }
.hero p { margin:0; color:#475569; }
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; }
.stats { display:grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:18px; }
.stat { background:#fff; border:1px solid #e5e7eb; border-radius:16px; padding:18px; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.stat span { display:block; font-size:1.9rem; font-weight:800; color:#0f172a; }
.stat small { color:#64748b; }
.card.wide { max-width:760px; margin-left:auto; margin-right:auto; }
.button.secondary { background:#e2e8f0; color:#0f172a; }
.smallbtn { padding:6px 9px; font-size:.84rem; }
.pill { display:inline-block; border-radius:999px; padding:3px 9px; font-size:.78rem; font-weight:700; background:#e2e8f0; color:#334155; }
.pill.active { background:#dcfce7; color:#166534; }
.pill.retired { background:#f1f5f9; color:#475569; }
.pill.compromised { background:#fee2e2; color:#991b1b; }
.danger-soft { background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
.inline-form { display:inline-block; margin:2px; }
.inline-form button { padding:6px 8px; font-size:.82rem; }
@media (max-width:760px){ .topbar,.hero{flex-direction:column;align-items:flex-start}.topbar nav{display:flex;flex-wrap:wrap;gap:8px} }

/* v4 rich notes and explorer */
.rich-editor{min-height:220px;background:#fff;border:1px solid #cfd5df;border-radius:10px;padding:14px;line-height:1.45;outline:none;box-sizing:border-box}.rich-editor:empty:before{content:attr(data-placeholder);color:#94a3b8}.rich-editor h2{margin:.4em 0}.editor-toolbar{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.editor-toolbar button{background:#e2e8f0;color:#0f172a;padding:7px 10px;font-size:.85rem}.access-fields{border:1px solid #e5e7eb;border-radius:12px;padding:12px;margin:12px 0;background:#fbfdff}.hero-actions .button{margin-right:6px;margin-bottom:6px}.container-label{font-weight:800;color:#0f172a}.file-tree{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.badge{display:inline-block;padding:2px 7px;border-radius:6px;background:#e0f2fe;color:#075985;font-size:.78rem;font-weight:700}
