/* Recall workspace shell: shared hierarchy, with a remembered icon rail on desktop. */
:root {
  --shell-header: 68px;
  --shell-menu: 224px;
  --sidebar: #142239;
  --sidebar-text: #c8d3e4;
}
:root[data-sidebar='collapsed'] {
  --shell-menu: 68px;
}
body.app {
  grid-template-columns: var(--shell-menu) minmax(0, 1fr);
  grid-template-rows: var(--shell-header) minmax(0, 1fr);
}
.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.shell-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  min-width: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.shell-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  font-size: 1.25rem;
  padding: 0;
  min-width: 184px;
  white-space: nowrap;
}
.recall-mark {
  width: 31px;
  height: 31px;
}
.shell-context {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.shell-context select {
  width: auto;
  max-width: 205px;
  min-width: 110px;
  background: var(--surface-2);
  padding: 7px 28px 7px 12px;
  font-weight: 600;
  text-overflow: ellipsis;
}
.shell-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 130px;
  max-width: 700px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.shell-search .ui-icon {
  color: var(--muted);
  width: 17px;
}
.shell-search input {
  border: 0;
  background: transparent;
  min-width: 0;
  padding: 8px 0;
  width: 100%;
}
.shell-search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.shell-search input:focus {
  outline: none;
  box-shadow: none;
}
.shell-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.shell-account,
.user-initials {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.shell-topbar .dev-banner {
  position: static;
  padding: 3px 6px;
  background: #ffdd73;
  color: #473300;
  border: 1px solid #d5a800;
  border-radius: 5px;
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  line-height: 1.3;
  max-width: 52px;
}
.shell-popover {
  position: relative;
}
.shell-popover > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.shell-popover > summary::-webkit-details-marker,
.item-actions > summary::-webkit-details-marker {
  display: none;
}
.shell-popover > summary:hover {
  background: var(--surface-2);
}
.shell-create > summary {
  background: var(--accent);
  color: var(--accent-text);
}
.shell-create > summary:hover {
  filter: brightness(1.08);
  background: var(--accent);
}
.shell-popover-body {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  max-width: calc(100vw - 24px);
  max-height: 65vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 14px 34px #0003;
  z-index: 70;
}
.shell-popover-body > strong {
  display: block;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.shell-popover-body > a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
}
.shell-popover-body > a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.shell-popover-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  top: var(--shell-header);
  height: calc(100vh - var(--shell-header));
  padding: 12px 10px;
  gap: 10px;
  border-right: 1px solid #ffffff0b;
  scrollbar-color: #718098 var(--sidebar);
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.shell-all-clients {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px;
}
.sidebar-toggle {
  order: 1;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
}
.sidebar-toggle:hover {
  background: #ffffff16;
}
.sidebar nav {
  flex: none;
  display: block;
}
.nav-group {
  margin: 0 0 10px;
}
.nav-group-label {
  padding: 7px 9px 4px;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #99acc5;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
.sidebar nav a .ui-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  opacity: 0.9;
}
.sidebar nav a.active {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: #fff;
}
.nav-settings {
  padding-top: 8px;
  border-top: 1px solid #ffffff15;
}
.sidebar-user {
  margin-top: auto;
  padding: 10px 7px 0;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}
.sidebar-profile small {
  display: block;
  font-size: 0.65rem;
  opacity: 0.65;
}
.sidebar .user-initials {
  width: 28px;
  height: 28px;
  color: white;
  background: #ffffff18;
}
.theme-switch {
  display: flex;
  gap: 3px;
  margin-top: 10px;
}
.shell-signout {
  font-size: 0.75rem;
}
body.app .content {
  grid-column: 2;
  grid-row: 2;
  padding: 20px 28px 32px;
}
.tabstrip {
  margin-bottom: 20px;
  padding: 4px 0 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
}
.ts-group-label {
  font-size: 0.72rem;
  padding: 4px 8px;
}
.ts-tab {
  font-size: 0.8rem;
}
.page-head {
  margin-bottom: 18px;
}
.page-head h1 {
  letter-spacing: -0.025em;
  font-size: 1.65rem;
}
.crumbs {
  font-size: 0.75rem;
  margin-bottom: 8px;
}
.panel {
  border-radius: 10px;
  box-shadow: 0 1px 2px #00000003;
}
.table th {
  font-size: 0.7rem;
  letter-spacing: 0.025em;
}
.table td {
  padding-top: 11px;
  padding-bottom: 11px;
}
.table.compact td {
  padding-top: 8px;
  padding-bottom: 8px;
}
h3 {
  font-size: 0.95rem;
}
body.full-bleed {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
body.full-bleed .shell-topbar,
body.full-bleed .sidebar {
  display: none;
}
body.full-bleed .content {
  grid-column: 1;
  grid-row: 1;
}
html.in-peek .shell-topbar,
html.in-peek .sidebar {
  display: none !important;
}
html.in-peek body.app {
  grid-template-rows: 1fr;
}
html.in-peek body.app .content {
  grid-column: 1;
  grid-row: 1;
}
@media (min-width: 901px) {
  :root[data-sidebar='collapsed'] .sidebar .nav-label,
  :root[data-sidebar='collapsed'] .nav-group-label {
    display: none;
  }
  :root[data-sidebar='collapsed'] .sidebar {
    padding-left: 8px;
    padding-right: 8px;
  }
  :root[data-sidebar='collapsed'] .sidebar-heading {
    flex-direction: column;
    align-items: center;
  }
  :root[data-sidebar='collapsed'] .sidebar-toggle {
    align-self: center;
    order: 0;
  }
  :root[data-sidebar='collapsed'] .sidebar nav a {
    justify-content: center;
    padding: 9px;
  }
  :root[data-sidebar='collapsed'] .nav-group {
    padding-bottom: 7px;
    margin-bottom: 7px;
    border-bottom: 1px solid #ffffff12;
  }
  :root[data-sidebar='collapsed'] .sidebar-profile {
    justify-content: center;
  }
  :root[data-sidebar='collapsed'] .sidebar-toggle .ui-icon {
    transform: rotate(180deg);
  }
  :root[data-sidebar='collapsed'] .theme-switch {
    flex-direction: column;
  }
  :root[data-sidebar='collapsed'] .sidebar-user {
    padding-left: 0;
    padding-right: 0;
    text-align: center;
  }
}
@media (max-width: 1200px) {
  .shell-topbar {
    gap: 10px;
    padding: 10px 14px;
  }
  .shell-topbar .brand {
    min-width: auto;
  }
  .shell-context select {
    max-width: 155px;
  }
  .shell-account {
    display: none;
  }
  .shell-top-actions {
    gap: 5px;
  }
}
@media (max-width: 900px) {
  :root {
    --shell-header: auto;
    --shell-menu: 0px;
  }
  body.app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .shell-topbar {
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  .shell-topbar .brand {
    min-width: 0;
    margin-right: auto;
  }
  .shell-menu-button {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    border-color: var(--border);
    padding: 5px;
  }
  .shell-top-actions {
    order: 1;
    margin-left: 0;
  }
  .shell-context {
    order: 2;
    width: 100%;
  }
  .shell-context select {
    flex: 1;
    max-width: none;
    width: 0;
  }
  .shell-search {
    order: 3;
    max-width: none;
    flex: 1 1 100%;
  }
  .shell-top-actions .shell-popover > summary {
    font-size: 0.75rem;
    padding: 6px 9px;
  }
  .sidebar {
    display: none;
    position: static;
    height: auto;
    grid-column: 1;
    grid-row: 2;
  }
  body.nav-open .sidebar {
    display: flex;
  }
  body.app.nav-open .content {
    grid-row: 3;
  }
  .sidebar nav,
  .sidebar .sidebar-user {
    display: block !important;
  }
  .sidebar-toggle {
    display: none;
  }
  .sidebar nav a {
    min-height: 40px;
  }
  .sidebar-heading .shell-all-clients {
    padding: 8px 10px;
  }
  body.app .content {
    grid-column: 1;
    grid-row: 2;
    padding: 16px;
  }
  .shell-popover-body {
    position: fixed;
    top: auto;
    right: 12px;
    margin-top: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.network-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 17px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
}
.network-summary > div {
  min-width: 0;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.network-summary > div:last-child {
  border: 0;
}
.network-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}
.network-summary strong {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.record-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.record-tabs a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 15px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
}
.record-tabs a[aria-selected='true'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.record-tabs a:hover {
  color: var(--accent);
  text-decoration: none;
}
.record-page[hidden] {
  display: none !important;
}
.record-page > .panel {
  margin-bottom: 0;
}
.add-address {
  margin-top: 16px;
}
.add-address > summary {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.add-address > form {
  margin-top: 12px;
}
.item-actions {
  position: relative;
}
.item-actions > summary {
  padding: 5px 12px;
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  letter-spacing: 2px;
}
.item-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px #0002;
}
.item-actions-menu .btn {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  font-size: 0.8rem;
}
@media (min-width: 1300px) {
  body.peeking:not(:has(.peek-popup:not([hidden]))) .content {
    padding-right: min(40vw, 560px);
  }
  .peek:not(.peek-popup) {
    top: 68px;
    width: min(40vw, 530px);
  }
}
@media (max-width: 600px) {
  .network-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }
  .network-summary > div:nth-child(2) {
    border-right: 0;
  }
  .record-tabs a {
    padding: 9px 10px;
  }
}

@media (min-width: 901px) {
  :root:not([data-sidebar='collapsed']) .nav-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  :root:not([data-sidebar='collapsed']) .nav-tools .nav-group-label {
    grid-column: 1 / -1;
  }
  :root:not([data-sidebar='collapsed']) .sidebar .nav-tools a {
    flex-direction: column;
    gap: 3px;
    padding: 7px 2px;
    font-size: 0.62rem;
  }
}
.sidebar-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--sidebar);
}
html.in-peek .content {
  padding: 18px !important;
}
html.in-peek .page-head h1 {
  font-size: 1.2rem;
}
html.in-peek .page-head {
  margin-bottom: 12px;
}
body.is-dev .sidebar {
  box-shadow: none;
}
.sidebar .theme-switch .nav-label {
  display: none;
}
.sidebar .theme-switch button {
  min-width: 30px;
}
.ip-asset-choice {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 130px;
}
.ip-asset-choice .cell-input {
  width: 0;
  min-width: 90px;
  flex: 1;
}
.ip-asset-choice [data-record-peek] {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
}
.ip-asset-choice [data-record-peek]:hover {
  background: var(--surface-2);
}
.ip-asset-choice .ui-icon {
  width: 15px;
  height: 15px;
}
.record-page .table tbody tr:hover {
  background: var(--surface-2);
}
.record-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
/* Continue the navigation colour through the desktop logo area. */
@media (min-width: 901px) {
  .shell-topbar {
    padding-left: 0;
  }
  .shell-topbar .brand {
    flex: 0 0 var(--shell-menu);
    min-width: 0;
    align-self: stretch;
    margin: -10px 0;
    padding: 10px 20px;
    background: var(--sidebar);
    color: var(--sidebar-text) !important;
    box-shadow: 0 1px 0 var(--sidebar);
  }
  .shell-topbar .brand > span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .shell-topbar .recall-mark {
    flex-shrink: 0;
  }
  :root[data-sidebar='collapsed'] .shell-topbar .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  :root[data-sidebar='collapsed'] .shell-topbar .brand > span {
    display: none;
  }
  :root[data-sidebar='collapsed'] .shell-topbar .brand-logo {
    max-width: 36px;
  }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .shell-context select {
    max-width: 140px;
  }
}
/* ---------- Top bar: open tabs on the left, then the search and client icons, Recent and Create ---------- */
.shell-tabs {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  margin: -10px 0;
}
/* Tabs sit on the same centre line as the buttons to their right: rounded chips, the open one highlighted,
   and each client's tabs on a light tint of that client's colour. */
.shell-tabs .tabstrip {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  align-items: center;
}
.shell-tabs .ts-tabs,
.shell-tabs .ts-group,
.shell-tabs .ts-group-tabs {
  align-items: center;
  align-self: center;
}
.shell-tabs .ts-tabs {
  gap: 4px;
  padding: 2px 0;
}
.shell-tabs .ts-actions,
.shell-tabs .ts-group-label,
.shell-tabs .ts-ticket {
  margin: 0;
  align-self: center;
}
.shell-tabs .ts-tab,
.shell-tabs .ts-tab.active,
.shell-tabs .ts-group-tabs .ts-tab.active {
  height: 32px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
}
.shell-tabs .ts-tab.active,
.shell-tabs .ts-group-tabs .ts-tab.active {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 2px #0000001a;
}
.shell-tabs .ts-tab::before {
  display: none;
}
.shell-tabs .ts-group-tabs {
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--g) 12%, transparent);
}
.shell-icon-pop > summary {
  position: relative;
  padding: 7px;
  color: var(--muted);
}
.shell-icon-pop[open] > summary,
.shell-icon-pop > summary:hover {
  background: var(--surface-2);
  color: var(--text);
}
.shell-client-pop.has-client > summary {
  color: var(--g);
}
.shell-client-pop.has-client > summary::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g);
  box-shadow: 0 0 0 2px var(--surface);
}
.shell-search-pop .shell-popover-body {
  width: 440px;
  padding: 10px;
}
.shell-search-pop .shell-search {
  max-width: none;
}
.shell-search-pop .shell-popover-body p {
  margin: 8px 2px 0;
}
.shell-client-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 300px !important;
  padding: 12px !important;
}
.shell-client-body select {
  width: 100%;
  font-weight: 600;
}
.shell-client-body p {
  margin: 0;
}
@media (max-width: 900px) {
  .shell-tabs {
    order: 4;
    flex: 1 1 100%;
    margin: 0 -16px -12px;
    padding: 0 8px;
    border-top: 1px solid var(--border);
  }
  .shell-tabs:empty {
    display: none;
  }
}
