/* M7 Vault: IT Glue-style layout in M7 Services brand colors.
   Brand: navy #072a60 · blue #298dbf · teal #6ac6d3 · green #99cf45 · orange #ff9a16 · red-orange #ff6306 */
:root {
  --top: #072a60;            /* M7 navy */
  --top-2: #0f3a7a;
  --top-3: #24508f;
  --top-text: #d2ddee;
  --brand-orange: #ff9a16;
  --brand-red: #ff6306;
  --brand-teal: #6ac6d3;
  --brand-green: #99cf45;
  --brand-blue: #298dbf;
  --side: #ffffff;
  --side-border: #dfe3e8;
  --side-hover: #f2f5f7;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --muted-bg: #f7f8fa;
  --border: #dde2e7;
  --row-border: #eceff2;
  --text: #2a3138;
  --text-2: #4f5a65;
  --text-3: #7c8792;
  --accent: #1d76a8;          /* M7 blue, darkened so white text stays readable (AA) */
  --accent-hover: #155f89;
  --accent-soft: #e5f2f9;
  --accent-border: #b9dcef;
  --link: #1d6aa0;
  --link-soft: #e8f0fa;
  --ok: #2e7d32;
  --ok-soft: #e6f3e7;
  --warn: #a35e00;
  --warn-soft: #fdf2e0;
  --bad: #c0392b;
  --bad-soft: #fbeae8;
  --radius: 4px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12px; }
kbd, .kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--top-3); border-radius: 3px; padding: 0 5px; color: #9aa6b2; }
svg.i { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: 48px; background: var(--top); color: var(--top-text); display: flex; align-items: center; padding: 0 14px; box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.topbar:empty { display: none; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; font-size: 16px; margin-right: 18px; letter-spacing: .3px; }
.brand:hover { text-decoration: none; }
/* The logo's navy strokes need a light backdrop on the navy header. */
.brand-logo { display: grid; place-items: center; background: #fff; border-radius: 5px; padding: 3px 6px; height: 32px; }
.brand-logo img { height: 24px; width: auto; display: block; }
.brand-name { line-height: 1; }
.topnav { display: flex; height: 100%; }
.topnav a { color: var(--top-text); padding: 0 14px; display: flex; align-items: center; font-weight: 600; font-size: 13px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.topnav a:hover { color: #fff; text-decoration: none; background: var(--top-2); }
.topnav a.active { color: #fff; border-bottom-color: var(--brand-orange); background: var(--top-2); }
.search { position: relative; margin-left: auto; width: min(420px, 34vw); }
.search input[type=search] { width: 100%; height: 30px; border-radius: 3px; border: 1px solid var(--top-3); background: var(--top-2); color: #fff; padding: 0 34px 0 32px; font-size: 13px; outline: none; }
.search input[type=search]::placeholder { color: #9aa6b2; }
.search input[type=search]:focus { background: #fff; color: var(--text); border-color: var(--accent); }
.search .si { position: absolute; left: 10px; top: 7px; color: #9aa6b2; }
.search .kbd { position: absolute; right: 9px; top: 7px; }
.search input:focus ~ .kbd { display: none; }
.search-results { position: absolute; top: 36px; left: 0; right: 0; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.18); max-height: 70vh; overflow: auto; display: none; }
.search-results.open { display: block; }
.sr-group { padding: 8px 12px 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); font-weight: 700; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 6px 12px; color: var(--text); }
.sr-item:hover, .sr-item.sel { background: var(--link-soft); text-decoration: none; }
.sr-item .sub { color: var(--text-3); font-size: 11.5px; }
.sr-item .org { margin-left: auto; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

.top-menus { display: flex; align-items: center; gap: 2px; margin-left: 10px; height: 100%; }
.menu { position: relative; height: 100%; display: flex; align-items: center; }
.top-btn { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 3px; border: 0; background: none; color: var(--top-text); font: inherit; font-weight: 600; cursor: pointer; }
.top-btn:hover, .menu.open .top-btn { background: var(--top-2); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px; border-radius: 3px; color: var(--top-text); cursor: pointer; background: none; border: 0; font: inherit; }
.user-chip:hover, .menu.open .user-chip { background: var(--top-2); color: #fff; }
.user-chip .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.menu-pop { display: none; position: absolute; top: 44px; left: 0; min-width: 260px; max-width: 380px; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 4px 0; }
.menu-pop.right { left: auto; right: 0; }
.menu.open .menu-pop { display: block; }
.menu-title { padding: 8px 14px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); font-weight: 700; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 14px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--side-hover); text-decoration: none; }
.menu-empty { padding: 10px 14px 12px; color: var(--text-3); }
.menu-head { padding: 10px 14px 12px; border-bottom: 1px solid var(--row-border); margin-bottom: 4px; }
.menu-head .role-badge { margin-top: 6px; }
.fav-on { color: #e0a100; fill: #f5b800; }

/* ---------- Layout ---------- */
.app { min-height: calc(100vh - 48px); }
.org-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.sidebar { background: var(--side); border-right: 1px solid var(--side-border); padding: 0 0 24px; position: sticky; top: 48px; height: calc(100vh - 48px); overflow: auto; }
.side-org { padding: 14px 14px 12px; border-bottom: 1px solid var(--side-border); background: linear-gradient(#fafbfc, #fff); }
.side-org-row { display: flex; align-items: flex-start; gap: 6px; }
.side-org-name { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.3; flex: 1; }
.side-org .meta { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.side-sec { padding: 14px 14px 5px; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .7px; }
.side-link { display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; color: var(--text-2); border-left: 3px solid transparent; font-weight: 500; }
.side-link:hover { background: var(--side-hover); text-decoration: none; color: var(--text); }
.side-link.active { background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent-hover); font-weight: 700; }
.side-link .n { font-size: 11px; color: var(--text-3); background: #eef1f4; border-radius: 9px; padding: 0 7px; min-width: 22px; text-align: center; font-weight: 600; }
.side-link.active .n { background: var(--accent-border); color: var(--accent-hover); }
.side-link.zero { color: var(--text-3); }
.side-more summary { padding: 6px 14px 6px 15px; color: var(--text-3); cursor: pointer; font-size: 12px; list-style: none; }
.side-more summary::before { content: '▸ '; }
.side-more[open] summary::before { content: '▾ '; }
.side-sources { padding: 4px 14px; display: flex; gap: 5px; flex-wrap: wrap; }

.page { padding: 18px 24px 48px; max-width: 1500px; }
.crumbs { color: var(--text-3); font-size: 12px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.page-head h1 svg.i { width: 19px; height: 19px; color: var(--text-3); }
.page-head .actions, .org-hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.org-hero { display: flex; align-items: flex-start; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; border-top: 3px solid var(--top); }
.org-hero h1 { margin: 0; font-size: 21px; display: flex; align-items: center; gap: 6px; }
.org-hero .meta { display: flex; gap: 6px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 9px 16px; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.active { color: var(--text); border-bottom-color: var(--brand-orange); }
.tabs a:hover { text-decoration: none; color: var(--text); background: #eef1f4; }
.section-title { font-size: 15px; margin: 4px 0 14px; }
.sub-title { font-size: 13px; margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--row-border); display: flex; gap: 7px; align-items: center; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius); border: 1px solid #c9d0d7; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--muted-bg); border-color: #b8c1ca; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #eec2bd; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #eaeef2; }
.btn.sm { height: 25px; padding: 0 8px; font-size: 12px; }
.btn.block { width: 100%; height: 36px; margin-top: 6px; }
.btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { border: 0; background: none; color: var(--link); font: inherit; font-size: 12px; font-weight: 600; padding: 0 4px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; }
.icon-btn:hover { background: #eaeef2; color: var(--text); }
.fav-btn { border: 0; background: none; cursor: pointer; color: #b5bec7; padding: 2px; display: inline-grid; place-items: center; }
.fav-btn:hover { color: #e0a100; }
.fav-btn.on { color: #e0a100; }
.fav-btn.on svg { fill: #f5b800; }
.org-hero .fav-btn svg { width: 19px; height: 19px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=url], input[type=date], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid #c9d0d7; border-radius: var(--radius); padding: 5px 9px; width: 100%; min-height: 30px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, .editor:focus { outline: 2px solid var(--accent-border); border-color: var(--accent); }
input[readonly] { background: var(--muted-bg); color: var(--text-2); }
.inline-select { width: auto; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.filter-box { position: relative; }
.filter-box svg { position: absolute; left: 9px; top: 8px; color: var(--text-3); }
.filter-box .filter { padding-left: 30px; width: 260px; }
.bulk { display: flex; gap: 6px; align-items: center; padding-left: 8px; border-left: 1px solid var(--border); }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: #fff; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-2); background: #fff; padding: 9px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable:hover { color: var(--text); background: var(--muted-bg); }
.grid th.sorted { color: var(--text); }
.grid th .arrow { font-size: 9px; margin-left: 5px; color: var(--accent); }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--row-border); vertical-align: middle; }
.grid tbody tr:nth-child(even) { background: #fbfcfd; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #f1f6fb; }
.grid tr.selected, .grid tr.selected:hover { background: var(--accent-soft); }
.grid tr.clickable { cursor: pointer; }
.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .ck { width: 34px; text-align: center; padding-left: 8px; padding-right: 4px; }
.grid .primary-cell { font-weight: 600; color: var(--link); }
.dt-empty { padding: 28px; text-align: center; color: var(--text-3); }
.dt-foot { display: flex; align-items: center; gap: 12px; padding: 8px 2px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.dt-foot select { width: auto; min-height: 24px; padding: 1px 6px; margin: 0 4px; }
.pager { display: flex; gap: 3px; align-items: center; }

/* ---------- Cards, detail ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--row-border); font-weight: 700; font-size: 13px; background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; }
.card-h svg.i { color: var(--text-3); }
.card-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 14px; }
.card-b.flush { padding: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.fields { display: grid; grid-template-columns: 170px 1fr; }
.fields > div { padding: 8px 0; border-bottom: 1px solid var(--row-border); }
.fields .k { color: var(--text-3); font-size: 12px; font-weight: 600; padding-right: 12px; }
.fields .v { word-break: break-word; }
.fields .v.pre { white-space: pre-wrap; }
.fields > div:nth-last-child(-n+2) { border-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); }
.stat:hover { border-color: var(--accent); text-decoration: none; box-shadow: inset 0 -3px 0 var(--accent); }
.stat .n { font-size: 21px; font-weight: 700; }
.stat .l { color: var(--text-3); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--row-border); }
.list-plain.compact li { padding: 6px 14px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .sub { color: var(--text-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--text-3); }
.empty.error { color: var(--bad); }
.home-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text); font-weight: 600; font-size: 12px; }
.chip:hover { border-color: var(--accent); color: var(--accent-hover); text-decoration: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: #edf0f3; color: var(--text-2); white-space: nowrap; }
.pill svg.i { width: 12px; height: 12px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--link-soft); color: var(--link); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: #eef1f4; color: var(--text-2); border: 1px solid #e1e6ea; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: #cfe5d0; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.src.cw { color: #0b6b5d; border-color: #9fd6cc; background: #ecf8f5; }
.src.ninja { color: #6b3fb5; border-color: #cdb8ef; background: #f4effc; }
.src.m365 { color: #b4480b; border-color: #f2c3a3; background: #fdf2ea; }
.src.itg { color: #3f6212; border-color: #c2dd9b; background: #f3f9ea; }
.src.meraki { color: #0b6e99; border-color: #a6d6ec; background: #eaf6fb; }
.src.rest { color: #475569; border-color: #cbd5e1; background: #f1f5f9; }
a.src:hover { text-decoration: none; filter: brightness(.95); }
.role-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 3px; }
.role-super_admin { background: var(--top); color: #fff; }
.role-admin { background: var(--accent); color: #fff; }
.role-editor { background: var(--link-soft); color: var(--link); }
.role-lite { background: #edf0f3; color: var(--text-2); }
.roles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.role-card p { margin: 6px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.45; }

/* ---------- Passwords / OTP ---------- */
.secret { display: inline-flex; align-items: center; gap: 2px; }
.secret .val { font-family: var(--mono); letter-spacing: .5px; min-width: 88px; }
.secret .dots { color: var(--text-3); letter-spacing: 2px; }
.otp { display: inline-flex; align-items: center; gap: 7px; }
.otp .code { font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: 1.5px; color: var(--text); }
.otp.big .code { font-size: 22px; }
.otp .ring { width: 18px; height: 18px; }
.otp .ring circle { fill: none; stroke-width: 3; }
.otp .ring .bg { stroke: #e3e8ee; }
.otp .ring .fg { stroke: var(--accent); transform: rotate(-90deg); transform-origin: 50% 50%; }
.otp.low .ring .fg { stroke: var(--bad); }
.otp.low .code { color: var(--bad); }

/* ---------- Forms ---------- */
.form { max-width: 900px; }
.form.card { padding: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.field .help { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.4; }
.field .req { color: var(--bad); }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--row-border); align-items: center; }
.banner { background: var(--warn-soft); color: #6f4300; border: 1px solid #f0d6a6; border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.5; }
.banner.info { background: var(--link-soft); color: #1d4f86; border-color: #c7dbf1; }
.test-result { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.test-result.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #c7e3c9; }
.test-result.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #f0c8c3; }

/* ---------- Rich text ---------- */
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border: 1px solid #c9d0d7; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--muted-bg); flex-wrap: wrap; }
.rte-toolbar button { border: 0; background: none; height: 28px; min-width: 28px; border-radius: 3px; cursor: pointer; font: inherit; font-weight: 700; color: var(--text-2); }
.rte-toolbar button:hover { background: #e4e9ef; }
.editor { min-height: 320px; border: 1px solid #c9d0d7; border-radius: 0 0 var(--radius) var(--radius); padding: 14px 16px; background: #fff; overflow: auto; }
.doc-body { line-height: 1.6; max-width: 900px; }
.doc-body h1, .doc-body h2, .doc-body h3, .editor h2, .editor h3 { margin: 1.2em 0 .4em; line-height: 1.3; }
.doc-body h2:first-child, .editor h2:first-child { margin-top: 0; }
.doc-body table, .editor table { border-collapse: collapse; margin: 10px 0; }
.doc-body th, .doc-body td, .editor th, .editor td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.doc-body th, .editor th { background: var(--muted-bg); }
.doc-body code, .editor code { background: #f1f4f7; padding: 1px 5px; border-radius: 3px; }
.doc-body pre, .editor pre { background: #f1f4f7; padding: 10px 12px; border-radius: var(--radius); overflow: auto; }
.quick-notes { line-height: 1.55; }
.quick-notes p { margin: 0 0 8px; }
.folder-h { font-weight: 700; color: var(--text-2); padding: 14px 0 6px; display: flex; align-items: center; gap: 8px; }

/* ---------- Integrations ---------- */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 14px; }
.int-logo { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.int-meta { color: var(--text-3); font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.int-actions { display: flex; gap: 8px; margin-top: 12px; }
.log { font-family: var(--mono); font-size: 11.5px; max-height: 280px; overflow: auto; background: #1f262d; color: #c7d2de; border-radius: var(--radius); padding: 10px 12px; margin-top: 12px; }
.card-b > .log:first-child { margin-top: 0; }
.log .warn { color: #f5c26b; }
.log .error { color: #ff8a8a; }
.log .ts { color: #6b7d90; margin-right: 8px; }
.catalog .cat-group { margin-bottom: 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cat-card .card-b { display: flex; flex-direction: column; gap: 8px; height: 100%; align-items: flex-start; }
.cat-card p { margin: 0; color: var(--text-2); line-height: 1.45; flex: 1; }
.cat-top { display: flex; gap: 10px; align-items: center; }
.cat-card.taken { background: #fbfcfd; }
.fields-editor td { padding: 5px 6px; }
.fields-editor input, .fields-editor select { min-height: 28px; padding: 3px 7px; }
.user-form { border-top: 3px solid var(--accent); }

/* ---------- Auth ---------- */
body.auth-mode { background: var(--top); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1100px 560px at 50% -10%, #17468c, var(--top)); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 6px; padding: 28px 28px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.35); border-top: 4px solid var(--brand-orange); }
.auth-card.inline { margin: 20px auto; box-shadow: none; border: 1px solid var(--border); border-top: 4px solid var(--brand-orange); }
.auth-card h1 { font-size: 19px; margin: 0 0 14px; }
.auth-card p { line-height: 1.5; margin: 0 0 14px; }
.auth-card .field { margin-bottom: 14px; }
.auth-brand { display: flex; align-items: flex-end; gap: 10px; font-weight: 800; font-size: 24px; margin-bottom: 20px; color: var(--top); letter-spacing: .3px; }
.auth-brand img { height: 46px; width: auto; }
.auth-brand span { line-height: 1; padding-bottom: 3px; }
.auth-err { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; font-weight: 600; }
.auth-foot { color: #9fb2cf; font-size: 12px; margin-top: 16px; }

/* ---------- Toasts / misc ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--top); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.2); font-size: 13px; animation: in .15s ease-out; max-width: 400px; border-left: 4px solid var(--accent); }
.toast.error { border-left-color: #ff8a7a; background: #5a1f19; }
@keyframes in { from { transform: translateY(6px); opacity: 0; } }
.spinner { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; color: var(--text-3); display: flex; gap: 10px; align-items: center; justify-content: center; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(3, 1fr) !important; }
  .roles-grid { grid-template-columns: 1fr 1fr; }
  .top-btn .lbl, .user-chip .nm { display: none; }
}
@media (max-width: 760px) {
  .org-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .topnav a { padding: 0 8px; }
  .page { padding: 14px 16px; }
  .form-grid, .cols-2, .home-strip, .roles-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 120px 1fr; }
  .search { width: 40vw; }
  .search .kbd { display: none; }
  .int-grid { grid-template-columns: 1fr; }
  .filter-box .filter { width: 180px; }
}

/* ---------- v0.3: link/rich-text fields, statuses, tags, archive, embeds ---------- */
.link-pick { border: 1px solid #c9d0d7; border-radius: var(--radius); background: #fff; }
.link-pick .link-filter { border: 0; border-bottom: 1px solid var(--row-border); border-radius: var(--radius) var(--radius) 0 0; }
.link-list { max-height: 190px; overflow: auto; padding: 4px 0; }
.link-opt { display: flex; align-items: center; gap: 7px; padding: 3px 10px; cursor: pointer; font-weight: 500 !important; margin: 0 !important; color: var(--text) !important; font-size: 12.5px !important; }
.link-opt:hover { background: var(--side-hover); }
.link-pick .help { padding: 0 10px 8px; }
.link-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid #cfe0f3; background: var(--link-soft); border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.link-chip svg.i { width: 12px; height: 12px; }
.link-chip.stale { background: #f3f4f6; border-color: #e1e4e8; color: var(--text-3); font-weight: 500; text-decoration: line-through; }
.form-sec { border-bottom: 1px solid var(--row-border); padding-bottom: 4px; margin-top: 6px; }
.form-sec h4 { margin: 0; font-size: 13px; color: var(--text); }
.fields .fsec { grid-column: 1 / -1; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); padding: 14px 0 6px; border-bottom: 2px solid var(--border); }
.rt-field { max-width: none; line-height: 1.5; }
.rt-field > :first-child { margin-top: 0; }
.rt-field > :last-child { margin-bottom: 0; }
.rte .editor { min-height: 120px; }
.embed-frame { display: block; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.embed-blocked { padding: 10px 12px; border: 1px dashed #e0b4ae; background: var(--bad-soft); color: var(--bad); border-radius: var(--radius); font-size: 12px; margin: 6px 0; }
.tag.st-green { background: var(--ok-soft); color: var(--ok); border-color: #cfe5d0; }
.tag.st-blue { background: var(--link-soft); color: var(--link); border-color: #c7dbf1; }
.tag.st-amber { background: var(--warn-soft); color: var(--warn); border-color: #f0d6a6; }
.tag.st-red { background: var(--bad-soft); color: var(--bad); border-color: #f0c8c3; }
.tag.st-purple { background: #f4effc; color: #6b3fb5; border-color: #ddd0f4; }
.tag.st-gray { background: #eef1f4; color: var(--text-3); }
.tag svg.i { width: 11px; height: 11px; vertical-align: -1px; }
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.otag { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #f1f3f6; color: var(--text-2); border: 1px solid #e3e7eb; }
.otag.more { background: #fff; }
.banner.archived { background: #eef1f4; color: var(--text-2); border-color: #dde2e7; }
.src.cove { color: #9a3412; border-color: #fdc9a7; background: #fff4ec; }

/* ---------- v0.4: coverage, gates, attachments, sections ---------- */
.cov-wrap { max-height: calc(100vh - 230px); }
.cov-grid th.cov-h { height: 150px; vertical-align: bottom; padding: 4px 2px; width: 30px; min-width: 30px; }
.cov-grid th.cov-h span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 600; font-size: 11px; max-height: 140px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.cov-grid .cov-org { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 220px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-grid thead .cov-org { z-index: 3; }
.cov-grid td.cov-c { text-align: center; padding: 4px 2px; }
.cov-grid td.cov-c a:hover { text-decoration: none; }
.cov { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.cov.done { background: var(--ok-soft); color: var(--ok); }
.cov.na { background: #eef1f4; color: var(--text-3); font-size: 9.5px; }
.cov.missing { color: #c3cad1; }
.pct { display: inline-block; min-width: 44px; padding: 1px 6px; border-radius: 3px; font-weight: 700; font-size: 11.5px;
  background: linear-gradient(90deg, var(--ok-soft) calc(var(--p) * 1%), #f4f5f7 0); }
.stat-btn { text-align: left; font: inherit; cursor: pointer; }
.stat-btn.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.banner.gate-off { background: #eef1f4; color: var(--text-2); border-color: #dde2e7; }
.attach-card.drop, #attach.drop .attach-card { outline: 2px dashed var(--accent); outline-offset: -4px; }
.attach-name { text-align: left; font-size: 13px; padding: 0; }
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 14px; }
.sec-grid label { display: flex; align-items: center; gap: 8px; }
.sec-grid label span { width: 26px; color: var(--text-3); font-weight: 700; }
.dup .card-h { flex-wrap: wrap; }

/* ---------- M7 brand accents ---------- */
/* Thin multi-color stripe under the header, echoing the logo's facets. */
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, var(--brand-orange) 0 20%, var(--brand-red) 20% 40%, var(--brand-teal) 40% 60%, var(--brand-blue) 60% 80%, var(--brand-green) 80% 100%); }
.user-chip .av { background: var(--brand-orange); color: var(--top); }
.toast { border-left-color: var(--brand-orange); }

/* ---------- v0.5: SSO + MFA ---------- */
.ms-btn { background: #fff; border: 1px solid #8c8c8c; color: #5e5e5e; font-weight: 600; gap: 10px; height: 40px; font-size: 14px; }
.ms-btn:hover { background: #f3f3f3; border-color: #5e5e5e; color: #2b2b2b; text-decoration: none; }
.local-login { margin-top: 18px; border-top: 1px solid var(--row-border); padding-top: 12px; }
.local-login summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: 6px; text-align: center; height: 46px; }
.enroll-steps { padding-left: 20px; line-height: 1.6; margin: 0 0 14px; }
.enroll-steps li { margin-bottom: 8px; }
.secret-key { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; background: var(--muted-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.secret-key code { font-size: 15px; letter-spacing: 1.5px; font-weight: 700; color: var(--top); word-break: break-all; }
.setup-steps ol { padding-left: 18px; margin: 0 0 10px; }
.setup-steps li { margin-bottom: 8px; line-height: 1.5; }

/* ---------- Authenticator QR enrollment ---------- */
.qr-enroll { display: flex; gap: 16px; align-items: center; margin: 4px 0 12px; }
.qr-box { flex: none; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 6px; line-height: 0; }
.qr-box svg { display: block; width: 184px; height: 184px; }
.qr-enroll .enroll-steps { margin: 0; font-size: 12.5px; }
.qr-manual { margin: 0 0 14px; }
.qr-manual summary { cursor: pointer; font-size: 12px; color: var(--link); font-weight: 600; }
@media (max-width: 480px) { .qr-enroll { flex-direction: column; align-items: flex-start; } }

/* ---------- Network documentation & maps ---------- */
.empty-cta { text-align: center; padding: 18px 10px; }
.empty-cta p { margin: 0 0 10px; }
.ip-list { max-height: 360px; overflow: auto; }
.grid tr.dup-ip td { background: var(--bad-soft); }
.sn-edit input { min-height: 26px; padding: 2px 6px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--border); border-radius: 8px; cursor: pointer; text-align: center; color: var(--text-2); }
.dropzone svg.i { width: 26px; height: 26px; color: var(--accent); }
.dropzone:hover, .dropzone.drop { border-color: var(--accent); background: var(--accent-soft); }
.import-preview { margin-top: 6px; }
.role-chips, .map-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.role-chips { margin: 4px 0 10px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, #fff); background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--text); font: inherit; font-size: 12px; cursor: default; }
button.role-chip { cursor: pointer; }
.role-chip svg.i { color: var(--c); width: 14px; height: 14px; }
.role-chip.off { opacity: .4; text-decoration: line-through; }
.legend-key { margin-left: auto; font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.lk { display: inline-block; width: 26px; border-top: 2px solid #7d8b99; }
.lk.dashed { border-top-style: dashed; }
.map-meta { margin: -8px 0 10px; }
.map-shell { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.map-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--row-border); flex-wrap: wrap; }
.map-toolbar .btn.on { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.map-legend { padding: 6px 10px; border-bottom: 1px solid var(--row-border); background: #fbfcfd; }
.map-body { position: relative; height: calc(100vh - 290px); min-height: 460px; }
.netmap { width: 100%; height: 100%; display: block; cursor: grab; background:
  radial-gradient(circle, #e3e8ed 1px, transparent 1px) 0 0 / 22px 22px; touch-action: none; user-select: none; }
.netmap:active { cursor: grabbing; }
.netmap .node { cursor: pointer; }
.netmap .node.dim { opacity: .25; }
.netmap .node.linking rect:first-child { stroke: var(--brand-orange); stroke-dasharray: 4 3; stroke-width: 2.5; }
.netmap .nlabel { font-size: 12px; font-weight: 700; fill: #2a3138; }
.netmap .nsub { font-size: 10.5px; fill: #6b7682; font-family: var(--mono); }
.netmap .port { font-size: 9.5px; fill: #4f5a65; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.netmap .speed { font-size: 9px; fill: #8b97a3; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.netmap .link .hit { cursor: help; }
.map-panel { position: absolute; top: 10px; right: 10px; bottom: 10px; width: 320px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: auto; padding: 0 0 10px; }
.panel-h { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; border-top: 4px solid; border-bottom: 1px solid var(--row-border); }
.map-panel .fields.compact { grid-template-columns: 96px 1fr; padding: 4px 14px; }
.map-panel .fields.compact > div { padding: 5px 0; font-size: 12.5px; }
.map-panel .fields.compact select { min-height: 26px; padding: 2px 6px; }
.panel-sec { margin: 10px 14px 4px; font-size: 12px; }
.map-panel .list-plain li { padding: 5px 14px; font-size: 12.5px; }
.grid.mini td { padding: 3px 6px; font-size: 11.5px; }
@media print {
  .topbar, .sidebar, .map-toolbar, .page-head .actions, .crumbs, .map-panel, .toasts { display: none !important; }
  .org-layout { display: block; }
  .map-body { height: 90vh; }
  .netmap { background: #fff; }
}
.tag { white-space: nowrap; }
.sched-line { margin-top: 6px; } .sched-line svg.i { width: 13px; height: 13px; }

/* Organization identifier (ConnectWise company Identifier) */
.org-id { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 8px; border-radius: 6px; background: #e8eef7; color: #1f3a66; border: 1px solid #cdd9ec; white-space: nowrap; }
