/* ============================================================
   systems-register.css — Three-lens Systems Register
   ============================================================
   Ported verbatim from the 6-5-2026 design handoff
   (_extracted_pib_design/systems.css), with class names
   preserved so the Razor markup matches the prototype.

   Inherits foundational tokens from portal.css:
     --ink, --ink-2/3/4, --rule, --rule-2, --paper, --paper-2,
     --white, --shadow-1/2, --green, --green-bg, --teal,
     --teal-bg, --gold, --gold-bg, --vis-public/internal/restricted

   Adds indigo Systems accent + classification vocabulary, register
   tables, filter toolbar, and the detail page chrome.
   ============================================================ */

:root {
  --sys: #423D8F;
  --sys-bright: #5A53BC;
  --sys-bg: #ECEBF8;
  --sys-line: rgba(66, 61, 143, 0.22);

  --cls-public: #2F6315;
  --cls-internal: #B8870E;
  --cls-restricted: #8A2A2A;
  --cls-confidential: #6B1414;
}

/* ───────── Masthead nav glue (page-specific overrides only) ───────── */
.topbar .brand-name, .topbar .brand-sub { white-space: nowrap; }

/* ───────── Page shell ───────── */
.reg-shell { max-width: 1180px; margin: 0 auto; padding: 28px 28px 96px; }
@media (max-width: 760px) { .reg-shell { padding: 20px 18px 80px; } }

/* ───────── Breadcrumb ───────── */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.crumbs .sep { color: var(--ink-4); }
.crumbs .here { color: var(--ink-2); font-weight: 500; }

/* ───────── Register header ───────── */
.reg-head { margin-bottom: 22px; }
.reg-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11px/1 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sys); margin-bottom: 10px;
}
.reg-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sys); }
.reg-title { font-family: "Source Serif 4", serif; font-size: 32px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin: 0 0 12px; }

/* lens switcher (segmented) */
.lens {
  display: inline-flex; padding: 3px; gap: 3px;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px;
  margin-bottom: 16px;
}
.lens a, .lens button {
  appearance: none; border: 0; background: transparent;
  font: 500 13.5px/1 "Inter", sans-serif; color: var(--ink-3);
  padding: 9px 16px; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .12s, color .12s, box-shadow .12s;
  text-decoration: none;
}
.lens a .count, .lens button .count { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.lens a.on, .lens button.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-1); }
.lens a.on .count, .lens button.on .count { color: var(--sys); }
.lens a.locked, .lens button.locked { color: var(--ink-4); }
.lens a svg, .lens button svg { width: 14px; height: 14px; }

/* legal-basis / context note */
.reg-note {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 14px 16px; border-radius: 10px;
  background: var(--sys-bg); border: 1px solid var(--sys-line);
  margin-bottom: 20px;
}
.reg-note.neutral { background: var(--paper-2); border-color: var(--rule); }
.reg-note .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--sys); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.reg-note.neutral .ic { background: var(--ink-3); }
.reg-note .t { font-size: 13px; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.reg-note .t b { color: var(--ink); font-weight: 600; }
.reg-note .t a { color: var(--sys); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* header top row — title/lens block on the left, the upper-right CTA card on the right */
.reg-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.reg-head-main { min-width: 0; }

/* "Request a review" CTA (Cloud lens only) — compact horizontal card: icon | text | button */
.reg-cta {
  flex: 0 0 460px; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 2px 14px;
  padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(180deg, var(--teal-bg), rgba(228,241,244,.3));
  border: 1px solid rgba(21,97,110,.16);
}
.reg-cta .ic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: rgba(21,97,110,.12); color: var(--teal); }
.reg-cta .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reg-cta .eyebrow { font: 600 10px/1 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.reg-cta .ttl { font: 600 15px/1.2 "Source Serif 4", serif; color: var(--ink); }
.reg-cta .blurb { font-size: 12px; color: var(--ink-2); line-height: 1.4; margin: 0; }
.reg-cta a.btn {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  font: 600 12.5px/1 "Inter", sans-serif; color: var(--teal); background: rgba(255,255,255,.6);
  border: 1px solid rgba(21,97,110,.3); padding: 9px 13px; border-radius: 8px; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.reg-cta a.btn:hover { background: #fff; border-color: var(--teal); }
@media (max-width: 1024px) {
  .reg-head-top { flex-direction: column; }
  .reg-cta { flex-basis: auto; width: auto; align-self: stretch; }
}

/* ───────── Toolbar (search + filters) ───────── */
.reg-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.reg-search { position: relative; flex: 1 1 240px; max-width: 320px; }
.reg-search input {
  width: 100%; font: 13.5px/1.4 "Inter", sans-serif; color: var(--ink);
  background: var(--white); border: 1px solid var(--rule); border-radius: 8px;
  padding: 9px 12px 9px 34px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.reg-search input:focus { border-color: var(--sys); box-shadow: 0 0 0 3px rgba(66,61,143,.13); }
.reg-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }

/* Server-rendered details/summary used in place of the prototype's React popover.
   Restyles <details>/<summary> to look like the design's filter button + popup. */
.filt { position: relative; }
.filt > summary {
  list-style: none;
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 13px/1 "Inter", sans-serif; color: var(--ink-2);
  background: var(--white); border: 1px solid var(--rule); border-radius: 8px;
  padding: 9px 11px; cursor: pointer; transition: border-color .12s, background .12s;
  user-select: none;
}
.filt > summary::-webkit-details-marker { display: none; }
.filt > summary:hover { background: var(--paper-2); }
.filt.has > summary { border-color: var(--sys); color: var(--sys); background: var(--sys-bg); }
.filt > summary .chev { color: var(--ink-4); }
.filt.has > summary .chev { color: var(--sys); }
.filt-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 190px; background: var(--white); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px;
}
.filt-pop label {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.filt-pop label:hover { background: var(--paper-2); }
.filt-pop input { accent-color: var(--sys); width: 15px; height: 15px; }

.reg-toolbar-spacer { flex: 1 1 auto; }
.reg-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg-clear, .reg-apply {
  appearance: none; border: 0; background: transparent;
  font: 500 12.5px/1 "Inter", sans-serif; color: var(--sys);
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
}
.reg-clear:hover, .reg-apply:hover { background: var(--sys-bg); }
.reg-apply {
  background: var(--sys); color: #fff; padding: 9px 13px;
  font-weight: 600; border-radius: 8px;
}
.reg-apply:hover { background: var(--sys-bright); }

/* active filter chips */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 "Inter", sans-serif;
  color: var(--sys); background: var(--sys-bg); border: 1px solid var(--sys-line);
  padding: 5px 6px 5px 9px; border-radius: 999px; text-decoration: none;
}
.af-chip:hover { background: #E2E0F4; }
.af-chip .x { display: inline-flex; padding: 1px; border-radius: 50%; }

/* ───────── Register table ───────── */
.reg-card { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-1); overflow: hidden; overflow-x: auto; }
table.reg { width: 100%; border-collapse: collapse; min-width: 760px; }
table.reg th {
  text-align: left; font: 600 10.5px/1.2 "Inter", sans-serif; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); padding: 13px 16px; background: var(--paper-2);
  border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: middle;
}
table.reg td { padding: 14px 16px; border-top: 1px solid var(--rule-2); font-size: 13.5px; color: var(--ink-2); vertical-align: middle; }
table.reg tbody tr { cursor: pointer; transition: background .1s; }
table.reg tbody tr:hover td { background: var(--paper-2); }
table.reg tbody tr:first-child td { border-top: 0; }
table.reg tbody tr.row-link a { color: inherit; text-decoration: none; display: block; }

.reg-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reg-name .nm { font-weight: 600; color: var(--ink); font-size: 14px; letter-spacing: -.005em; line-height: 1.3; }
.reg-name .sid { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--ink-3); }
.reg-cell-list { color: var(--ink-2); line-height: 1.4; }
.reg-cell-muted { color: var(--ink-3); }
.reg-trunc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 38ch; line-height: 1.4; }
.reg-trunc.obl { max-width: 30ch; font-size: 12.5px; color: var(--ink-2); }
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px/1 "Inter", sans-serif; color: var(--sys);
  background: var(--sys-bg); border: 1px solid var(--sys-line);
  padding: 7px 11px; border-radius: 7px; cursor: pointer;
  transition: background .12s, border-color .12s;
  text-decoration: none;
}
.dl-btn:hover { background: #E2E0F4; border-color: var(--sys-bright); }
.note-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 12px/1 "Inter", sans-serif; color: var(--ink-2);
  background: var(--white); border: 1px solid var(--rule);
  padding: 7px 11px; border-radius: 7px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.note-btn:hover { background: var(--paper-2); border-color: var(--ink-4); color: var(--ink); }
.reg-dash { color: var(--ink-4); }
td.reg-go { text-align: right; color: var(--ink-4); width: 28px; }
table.reg tbody tr:hover td.reg-go { color: var(--sys); }

.reg-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.reg-empty b { color: var(--ink-2); }

/* ───────── Chips (extend portal.css base .chip) ───────── */
.chip-sys        { color: var(--sys);            background: var(--sys-bg);   border-color: var(--sys-line); }
.chip-sys .chip-dot { background: var(--sys); }
.chip-neutral    { color: var(--ink-3);          background: var(--paper-2);  border-color: var(--rule); }
.chip-neutral .chip-dot { background: var(--ink-4); }
.chip-confidential { color: var(--cls-confidential); background: #F7E9E9; border-color: rgba(107,20,20,.22); }
.chip-confidential .chip-dot { background: var(--cls-confidential); }

/* dot-only class chips (Core / Common / Innovative) */
.chip-class { color: var(--ink-2); background: var(--paper-2); border-color: var(--rule); }
.chip-class .chip-dot.core { background: var(--gold); }
.chip-class .chip-dot.common { background: var(--teal); }
.chip-class .chip-dot.innovative { background: var(--sys-bright); }

/* residency */
.chip-res-alberta       { color: var(--green);  background: var(--green-bg); border-color: rgba(47,99,21,.22); }
.chip-res-alberta .chip-dot { background: var(--green); }
.chip-res-canada        { color: var(--teal);   background: var(--teal-bg);  border-color: rgba(21,97,110,.22); }
.chip-res-canada .chip-dot { background: var(--teal); }
.chip-res-mixed         { color: var(--gold);   background: var(--gold-bg);  border-color: rgba(184,135,14,.28); }
.chip-res-mixed .chip-dot { background: var(--gold); }
.chip-res-outside       { color: var(--cls-restricted); background: #FBEFEF; border-color: rgba(138,42,42,.22); }
.chip-res-outside .chip-dot { background: var(--cls-restricted); }

/* yes/no */
.chip-yes { color: var(--sys); background: var(--sys-bg); border-color: var(--sys-line); }
.chip-yes .chip-dot { background: var(--sys); }

/* ───────── Detail page ───────── */
.detail { max-width: 880px; margin: 0 auto; }
.detail-head { padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.detail-sid { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--sys); font-weight: 600; margin-bottom: 8px; }
.detail-title { font-family: "Source Serif 4", serif; font-size: 30px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin: 0 0 14px; line-height: 1.15; text-wrap: balance; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.sec { margin-bottom: 30px; }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-head h3 { font: 600 13px/1 "Inter", sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.sec-head .badge {
  font: 600 10px/1 "Inter", sans-serif; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px;
}
.sec-head .badge.public { color: var(--cls-public); background: var(--green-bg); }
.sec-head .badge.internal { color: var(--ink-3); background: var(--paper-2); }
.sec-head .badge .k { opacity: .7; }

/* field grid */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.field { padding: 14px 16px; background: var(--white); }
.field.full { grid-column: 1 / -1; }
.field-l { display: flex; align-items: center; gap: 8px; font: 600 10.5px/1 "Inter", sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.field-l .s57 { font-family: "JetBrains Mono", monospace; font-size: 9.5px; letter-spacing: 0; color: var(--sys); background: var(--sys-bg); padding: 2px 5px; border-radius: 4px; text-transform: none; }
.field-v { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.field-v.muted { color: var(--ink-3); }
.field-list { display: flex; flex-wrap: wrap; gap: 6px; }
.field-bullets { margin: 0; padding-left: 16px; }
.field-bullets li { font-size: 13.5px; color: var(--ink); line-height: 1.55; }
.minichip { display: inline-flex; align-items: center; font: 500 11.5px/1 "Inter", sans-serif; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--rule); padding: 5px 9px; border-radius: 999px; }
.ref-link { display: inline-flex; align-items: center; font: 500 12px/1 "JetBrains Mono", monospace; color: var(--sys); background: var(--sys-bg); border: 1px solid var(--sys-line); padding: 5px 9px; border-radius: 6px; text-decoration: none; }
.ref-link:hover { background: #E2E0F4; }

/* companion artifact rows */
.companions { display: flex; flex-direction: column; gap: 10px; }
.comp {
  display: grid; grid-template-columns: 40px 1fr auto auto; gap: 14px; align-items: center;
  padding: 14px 16px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px;
  text-decoration: none;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.comp:hover { border-color: var(--sys); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.comp.none { opacity: .7; pointer-events: none; }
.comp-ic { width: 40px; height: 40px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.comp-ic.pia { background: var(--cls-restricted); color: #fff; }
.comp-ic.risk { background: var(--sys); color: #fff; }
.comp-ic.notice { background: var(--green); color: #fff; }
.comp-ic.none { background: var(--paper-2); color: var(--ink-4); }
.comp-main { min-width: 0; }
.comp-kind { font: 600 10.5px/1 "Inter", sans-serif; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.comp-ttl { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.comp-id { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--ink-4); margin-top: 3px; }
.comp-open { display: inline-flex; align-items: center; gap: 5px; font: 600 12px/1 "Inter", sans-serif; color: var(--sys); }

/* internal block locked state */
.locked-block {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 20px 22px; background: var(--paper-2); border: 1px dashed var(--rule);
  border-radius: 10px;
}
.locked-block .ic { width: 38px; height: 38px; border-radius: 9px; background: var(--white); border: 1px solid var(--rule); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); }
.locked-block .t b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 3px; }
.locked-block .t span { font-size: 12.5px; color: var(--ink-3); }
.locked-block .signin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 12.5px/1 "Inter", sans-serif; color: #fff;
  background: var(--sys); border: 1px solid var(--sys);
  padding: 9px 14px; border-radius: 8px; text-decoration: none;
}
.locked-block .signin-btn:hover { background: var(--sys-bright); }

.detail-back { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 "Inter", sans-serif; color: var(--ink-3); margin-bottom: 18px; padding: 6px 10px 6px 6px; border-radius: 7px; text-decoration: none; }
.detail-back:hover { background: var(--paper-2); color: var(--ink); }

@media (max-width: 680px) {
  .fields { grid-template-columns: 1fr; }
  .reg-title { font-size: 26px; }
  .detail-title { font-size: 24px; }
}

/* ───────── Note modal (Cloud lens "View" button) ───────── */
.note-modal {
  border: none; border-radius: 12px;
  padding: 0; max-width: 540px; width: 90%;
  box-shadow: 0 18px 40px rgba(26,24,20,.2);
}
.note-modal::backdrop { background: rgba(15,15,20,.45); }
.note-modal .modal-head { padding: 20px 24px 12px; }
.note-modal .modal-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11px/1 "Inter", sans-serif; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sys); margin-bottom: 8px;
}
.note-modal .modal-title { font-family: "Source Serif 4", serif; font-size: 20px; font-weight: 500; color: var(--ink); margin: 0; line-height: 1.2; }
.note-modal .modal-body { padding: 4px 24px 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.note-modal .modal-body p { margin: 0 0 12px; }
.note-modal .modal-doc {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  padding: 12px 14px; background: var(--paper-2); border-radius: 8px; margin: 10px 0;
}
.note-modal .modal-doc .id { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--ink-3); }
.note-modal .modal-doc .ttl { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.note-modal .acl-note { margin-top: 12px; padding: 12px 14px; background: var(--paper-2); border-radius: 8px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.note-modal .acl-note b { color: var(--ink); }
.note-modal .modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 24px 18px; border-top: 1px solid var(--rule);
}
.note-modal .btn-ghost {
  appearance: none; border: 1px solid var(--rule); background: var(--white);
  font: 500 13px/1 "Inter", sans-serif; color: var(--ink-2);
  padding: 9px 13px; border-radius: 8px; cursor: pointer;
}
.note-modal .btn-ghost:hover { background: var(--paper-2); }
