/* Client Portal (C1) — inherit base theme from app.css; only layout tweaks here */
#ne6rp-client-host label { display:block; margin:8px 0; }

/* 3-up layout (margin gutters; immune to flex-gap quirks) */
#ne6rp-client-host .rp-grid-3 {
  display: flex;
  flex-wrap: wrap;
  margin: -12px;                             /* 24px total gutter */
}
#ne6rp-client-host .rp-grid-3 > * {
  box-sizing: border-box;
  margin: 12px !important;                   /* force visible gaps even if app.css zeroes margins */
  flex: 0 0 calc(33.333% - 24px);            /* width minus both side margins */
}

/* Responsive */
@media (max-width: 960px) {
  #ne6rp-client-host .rp-grid-3 > * { flex: 0 0 calc(50% - 24px); }
}
@media (max-width: 640px) {
  #ne6rp-client-host .rp-grid-3 > * { flex: 0 0 100%; }
}

/* (intentionally removed duplicate responsive block) */

/* KPI tiles use the same card visuals as the rest of the app (rp-card).
   We don’t restyle colors here to keep exact theme parity. */
#ne6rp-client-host .rp-kpi { text-align:center; padding:16px; }
#ne6rp-client-host .rp-kpi-num { font-size:22px; font-weight:700; margin-bottom:4px; }
#ne6rp-client-host .rp-kpi-label { opacity:0.75; font-size:12px; }

/* Hide tenant shell when viewing client routes as a guest */
html[data-auth="guest"] .rp-sidebar,
html[data-auth="guest"] header.rp-header,
html[data-auth="guest"] footer.rp-footer,
html[data-auth="guest"] #rn-drawer { display:none !important; }

/* Let the content take full width when shell is hidden */
html[data-auth="guest"] .rp-content { margin-left: 0 !important; }

/* Center the login card a bit nicer */
html[data-auth="guest"] #ne6rp-client-host .rp-card { max-width: 640px; margin: 24px auto; }

/* C6 P4: align with app.css pager + toolbar */
#ne6rp-client-host .rp-toolbar {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
#ne6rp-client-host .rp-toolbar input[type="search"] { min-width:220px; }

#ne6rp-client-host .rp-pager {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-top:8px;
}
#ne6rp-client-host .rp-pager button[disabled] { opacity:.5; cursor:not-allowed; }

/* Inline client selector in card header */
#ne6rp-client-host .rp-client-switch {
  display:flex; align-items:center; gap:8px;
}
#ne6rp-client-host .rp-client-switch .rp-label {
  font-weight:600;
}
#ne6rp-client-host .rp-client-switch select {
  min-width:220px;
}

/* C7: sortable headers */
#ne6rp-client-host th.rp-th-sort { cursor: pointer; position: relative; user-select: none; }
#ne6rp-client-host th.rp-th-sort .rp-th-caret { margin-left:6px; display:inline-block; width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; border-top:6px solid currentColor; opacity:.55; transform: translateY(-1px); }
#ne6rp-client-host th.rp-th-sort.is-desc .rp-th-caret { transform: rotate(180deg) translateY(1px); }

/* C7: very light loading shimmer (row placeholders) */
#ne6rp-client-host .rp-shimmer {
  position: relative; overflow: hidden; background: rgba(255,255,255,.06);
}
#ne6rp-client-host .rp-shimmer::after {
  content:''; position:absolute; inset:0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  animation: ne6rp-shimmer 1s infinite;
}
@keyframes ne6rp-shimmer { 100% { transform: translateX(100%); } }

/* Footer buttons default: neutral (override base .rp-btn fill) */
#ne6rp-client-host .rp-client-portal .rp-card-ft .rp-btn {
  background: transparent !important;
  color: var(--brand-7) !important;
  border: 1px solid var(--panel-border) !important;
}

/* Hover */
#ne6rp-client-host .rp-client-portal .rp-card-ft .rp-btn:hover {
  background: rgba(66,173,225,.10) !important;
}

/* Only the active one is filled */
#ne6rp-client-host .rp-client-portal .rp-card-ft .rp-btn.is-active {
  background: var(--brand-7) !important;
  color: var(--text-inverse) !important;
  border-color: var(--brand-7) !important;
}

/* C8: clickable URL cells (truncate nicely) */
#ne6rp-client-host a.rp-url{
  display:inline-block;
  max-width: 420px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* C8: footer button focus ring */
#ne6rp-client-host .rp-client-portal .rp-card-ft .rp-btn:focus {
  outline: 2px solid var(--brand-7);
  outline-offset: 2px;
}

/* C9: hydration—avoid flash while JS builds the portal chrome */
#ne6rp-client-host[data-hydrating="1"] { visibility: hidden; }
#ne6rp-client-host[data-hydrating="0"] { visibility: visible; }

/* C9.1: per-view hydration — keep layout to avoid flicker/jump */
#ne6rp-client-host [data-view-hydrating="1"] { visibility: hidden; }
#ne6rp-client-host [data-view-hydrating="0"] { visibility: visible; }