/* Admin navigation & Entwurf A ("Clean Settings") layout/typography layer. Plain CSS loaded after tailwind.css. */

:root {
  --nx-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nx-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Own display rules must not beat Tailwind's .hidden */
.nxn-row.hidden, .nxn-area.hidden, .nxn-more-btn.hidden, .nxn-tabbar.hidden, .nxn-results.hidden, .nxn-area-body.hidden, .nxn-more-list.hidden, .nxn-dot.hidden { display: none; }

/* ============================================================================
   1. SHELL, SURFACES & STRICT READABLE CONTENT WIDTHS (Entwurf A)
   ============================================================================ */
html[data-ui-scope="admin"] body {
  background-color: #f6f7f9;
}
html[data-ui-scope="admin"].dark body {
  background-color: #16171a;
}

#admSidebar {
  width: 248px;
  background-color: #ffffff;
  border-inline-end: 1px solid #e5e7eb;
}
.dark #admSidebar {
  background-color: #141518;
  border-inline-end-color: #262930;
}

#admTopbar {
  height: 46px;
  padding-inline: 16px;
  background-color: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e5e7eb;
}
.dark #admTopbar {
  background-color: rgba(22, 23, 26, 0.96);
  border-bottom-color: #262930;
}
.nx-topbar-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Single-row Topbar heading: Breadcrumb + Title + compact Docs link (zero wasted hero block) */
.nx-topbar-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}
.nx-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}
.dark .nx-breadcrumb { color: #94a3b8; }
.nx-breadcrumb-sep {
  color: #cbd5e1;
  user-select: none;
}
.dark .nx-breadcrumb-sep { color: #475569; }
.nx-topbar-title {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 340px;
}
.dark .nx-topbar-title { color: #f8fafc; }
.nx-topbar-docs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  color: #6b7280;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nx-topbar-docs:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}
.dark .nx-topbar-docs {
  color: #94a3b8;
}
.dark .nx-topbar-docs:hover {
  background: #23262d;
  border-color: #323640;
  color: #ffffff;
}
.nx-topbar-sub {
  display: none !important;
}
@media (max-width: 639px) {
  .nx-breadcrumb, .nx-topbar-docs { display: none; }
}

/* Main content container: strictly left-aligned right next to sidebar, equal 16px top & left padding, ONE constant readable max-width across ALL 44 pages */
#admMain {
  width: 100%;
  max-width: 1352px;
  margin: 0;
  padding: 16px 16px 20px;
}
#admMain > :not(.hidden):not([hidden]):not(.nxn-tabbar) ~ :not(.hidden):not([hidden]) {
  margin-top: 0.75rem;
}
@media (max-width: 767px) {
  #admMain {
    padding: 12px 12px 20px;
  }
  #admTopbar {
    padding-inline: 12px;
  }
}

/* ============================================================================
   2. UNIFIED TOPBAR SEARCH (replaces duplicate sidebar search + Ctrl+K button)
   ============================================================================ */
.nx-topbar-search {
  position: relative;
  width: 248px;
}
@media (max-width: 1023px) {
  .nx-topbar-search { width: 185px; }
}
@media (max-width: 639px) {
  .nx-topbar-search { width: 136px; }
  .nx-search-kbd { display: none; }
}
.nxn-search-ico {
  position: absolute;
  inset-inline-start: 9px;
  top: 50%;
  width: 0.875rem;
  height: 0.875rem;
  transform: translateY(-50%);
  color: #9ca3af;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  pointer-events: none;
}
.nxn-search-input {
  width: 100%;
  height: 30px;
  padding-inline-start: 28px;
  padding-inline-end: 50px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-size: 0.78rem;
  color: #111827;
  outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.nxn-search-input::placeholder { color: #9ca3af; }
.nxn-search-input:focus {
  background: #ffffff;
  border-color: rgb(var(--b-500));
  box-shadow: 0 0 0 3px rgb(var(--b-500) / .18);
}
.dark .nxn-search-input {
  background: #1e2024;
  border-color: #2e323b;
  color: #f3f4f6;
}
.dark .nxn-search-input:focus {
  background: #181a1e;
  border-color: rgb(var(--b-500));
}
.nxn-search-input::-webkit-search-cancel-button { cursor: pointer; }
.nx-search-kbd {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--nx-mono);
  font-size: 10px;
  line-height: 1.3;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  pointer-events: none;
}
.dark .nx-search-kbd {
  color: #94a3b8;
  background: #141518;
  border-color: #343842;
}

.nxn-results {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: min(380px, 90vw);
  z-index: 60;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 14px 36px rgb(15 23 42 / .14);
}
.dark .nxn-results {
  background: #1e2024;
  border-color: #343842;
  box-shadow: 0 14px 36px rgb(0 0 0 / .55);
}
.nxn-res {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  text-align: start;
  cursor: pointer;
  color: #374151;
}
.dark .nxn-res { color: #d1d5db; }
.nxn-res svg { width: 0.95rem; height: 0.95rem; margin-top: 2px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; color: #9ca3af; }
.nxn-res-t { display: block; font-size: 0.8125rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.nxn-res-p { display: block; font-size: 0.6875rem; color: #6b7280; line-height: 1.3; margin-top: 1px; }
.dark .nxn-res-p { color: #94a3b8; }
.nxn-res[aria-selected="true"], .nxn-res:hover { background: rgb(var(--b-50)); color: #111827; }
.dark .nxn-res[aria-selected="true"], .dark .nxn-res:hover { background: rgb(255 255 255 / .07); color: #ffffff; }
.nxn-res[aria-selected="true"] svg { color: rgb(var(--b-600)); }
.nxn-res-empty { padding: 14px 10px; text-align: center; font-size: 0.75rem; color: #9ca3af; }

/* ============================================================================
   3. CLEAN 3-LEVEL SIDEBAR (Area -> Page -> Sub-tabs with matching icons)
   ============================================================================ */
.nx-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--nx-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
}
.dark .nx-live-pill { color: #4ade80; }
.nx-live-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.nxn-cap { display: flex; align-items: center; gap: 5px; padding: 0 8px 2px; font-size: 0.6875rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #9ca3af; }
.dark .nxn-cap { color: #6b7280; }
.nxn-cap svg { width: 0.72rem; height: 0.72rem; fill: none; stroke: currentColor; stroke-width: 2; }
.nxn-quick-grp { padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.dark .nxn-quick-grp { border-color: #23262d; }
.nxn-cap-btn { margin-inline-start: auto; display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border-radius: 5px; color: #9ca3af; cursor: pointer; }
.nxn-cap-btn:hover, .nxn-cap-btn:focus-visible { background: rgb(0 0 0 / .06); color: #111827; }
.dark .nxn-cap-btn:hover, .dark .nxn-cap-btn:focus-visible { background: rgb(255 255 255 / .08); color: #ffffff; }
.nxn-cap-btn svg { width: 0.8rem; height: 0.8rem; }

.nxn-area-btn {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  padding: 0.28rem 0.45rem;
  border-radius: 7px;
  font-size: 0.78125rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  user-select: none;
  transition: background .1s, color .1s;
}
.nxn-area-btn:hover { background: #f3f4f6; color: #111827; }
.dark .nxn-area-btn { color: #cbd5e1; }
.dark .nxn-area-btn:hover { background: rgb(255 255 255 / .05); color: #ffffff; }
.nxn-area-btn > svg { width: 0.9rem; height: 0.9rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; color: #9ca3af; }
.nxn-area-btn .nxn-chev { width: 0.72rem; height: 0.72rem; margin-inline-start: auto; transition: transform .12s; }
.nxn-area-btn[aria-expanded="true"] .nxn-chev { transform: rotate(90deg); }
.nxn-area.is-current > .nxn-area-btn { color: #111827; }
.nxn-area.is-current > .nxn-area-btn > svg:first-child { color: rgb(var(--b-600)); }
.dark .nxn-area.is-current > .nxn-area-btn { color: #ffffff; }
.dark .nxn-area.is-current > .nxn-area-btn > svg:first-child { color: rgb(var(--b-400)); }
.nxn-dot { width: 6px; height: 6px; border-radius: 999px; background: #f43f5e; flex-shrink: 0; }
.nxn-dot.is-amber { background: #f59e0b; }
.nxn-area-body { margin: 2px 0 4px 9px; padding-inline-start: 5px; border-inline-start: 1px solid #e5e7eb; }
.dark .nxn-area-body { border-color: #2b2f38; }

.nxn-row { position: relative; display: flex; flex-wrap: wrap; align-items: center; }
.nxn-row > .nav-item {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 0.75rem !important;
  line-height: 1.3 !important;
  padding-inline: 7px 6px;
  padding-block: 4px;
  gap: 6px;
}
.nxn-row:hover > .nav-item,
.nxn-row:has(.nxn-pin.is-on) > .nav-item {
  padding-inline-end: 22px;
}
.nxn-pin { position: absolute; inset-inline-end: 2px; top: 0.75rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border-radius: 5px; color: #9ca3af; opacity: 0; cursor: pointer; transition: opacity .1s, background .1s, color .1s; }
.nxn-pin svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: currentColor; stroke-width: 1.9; }
.nxn-row:hover .nxn-pin, .nxn-pin:focus-visible, .nxn-pin.is-on { opacity: 1; }
.nxn-pin:hover { background: rgb(0 0 0 / .06); color: #111827; }
.dark .nxn-pin:hover { background: rgb(255 255 255 / .08); color: #ffffff; }
.nxn-pin.is-on { color: rgb(var(--b-600)); }
.dark .nxn-pin.is-on { color: rgb(var(--b-400)); }
@media (hover: none) { .nxn-pin { opacity: .55; } }

/* Expanded level-2 page with visible level-3 sub-tabs: act as parent heading while the active leaf sits on level 3 */
.nxn-row:has(.nxn-sublist) > .nav-item.active {
  background-color: transparent !important;
  color: #111827 !important;
  font-weight: 600;
}
.nxn-row:has(.nxn-sublist) > .nav-item.active:hover {
  background-color: #f3f4f6 !important;
}
.dark .nxn-row:has(.nxn-sublist) > .nav-item.active {
  background-color: transparent !important;
  color: #ffffff !important;
}
.dark .nxn-row:has(.nxn-sublist) > .nav-item.active:hover {
  background-color: rgb(255 255 255 / .05) !important;
}
.nxn-row:has(.nxn-sublist) > .nav-item.active::before {
  content: none !important;
}

/* Level-3 sidebar sub-tabs (matching content underline tabs + icons) */
.nxn-sublist {
  width: 100%;
  margin: 2px 0 4px 12px;
  padding-inline-start: 5px;
  border-inline-start: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dark .nxn-sublist {
  border-color: #2b2f38;
}
.nxn-subitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 3.5px 6px 3.5px 7px;
  border-radius: 6px;
  font-size: 0.71875rem;
  font-weight: 500;
  line-height: 1.3;
  color: #525866;
  text-align: start;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.nxn-subitem > svg {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
  color: #9ca3af;
  transition: color .1s;
}
.nxn-subitem:hover {
  background: #f3f4f6;
  color: #111827;
}
.nxn-subitem:hover > svg {
  color: #4b5563;
}
.dark .nxn-subitem {
  color: #9ca3af;
}
.dark .nxn-subitem > svg {
  color: #717784;
}
.dark .nxn-subitem:hover {
  background: rgb(255 255 255 / .05);
  color: #ffffff;
}
.dark .nxn-subitem:hover > svg {
  color: #cbd5e1;
}
.nxn-subitem[aria-current="true"] {
  background: rgb(var(--b-50) / .85);
  color: #111827;
  font-weight: 600;
}
.nxn-subitem[aria-current="true"]::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  background: rgb(var(--b-600));
}
.nxn-subitem[aria-current="true"] > svg {
  color: rgb(var(--b-600));
}
.dark .nxn-subitem[aria-current="true"] {
  background: rgb(255 255 255 / .08);
  color: #ffffff;
}
.dark .nxn-subitem[aria-current="true"]::before {
  background: rgb(var(--b-500));
}
.dark .nxn-subitem[aria-current="true"] > svg {
  color: rgb(var(--b-400));
}
.nxn-subitem-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: .55;
  flex-shrink: 0;
}
.nxn-subitem[aria-current="true"] .nxn-subitem-dot {
  opacity: 1;
  transform: scale(1.2);
}

.nxn-row.is-inactive > .nav-item { opacity: .55; }
.nxn-row.is-inactive > .nav-item:hover, .nxn-row.is-inactive > .nav-item.active { opacity: .85; }

.nxn-more-btn { display: flex; width: 100%; align-items: center; gap: 5px; margin-top: 3px; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: #6b7280; cursor: pointer; }
.nxn-more-btn:hover { background: #f3f4f6; color: #111827; }
.dark .nxn-more-btn { color: #787f8e; }
.dark .nxn-more-btn:hover { background: rgb(255 255 255 / .05); color: #e5e7eb; }
.nxn-more-btn svg { width: 0.75rem; height: 0.75rem; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .12s; }
.nxn-more-btn[aria-expanded="true"] svg { transform: rotate(90deg); }

/* Mobile area bar (hidden on desktop >= 1024px) */
.nxn-tabbar { display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid #e5e7eb; margin-bottom: 12px; }
.dark .nxn-tabbar { border-color: #2b2f38; }
.nxn-tabbar-area { display: flex; align-items: center; gap: 5px; padding: 0 2px 7px; font-size: 0.6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #6b7280; white-space: nowrap; flex-shrink: 0; }
.nxn-tabbar-area svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.8; color: rgb(var(--b-600)); }
.dark .nxn-tabbar-area svg { color: rgb(var(--b-400)); }
.nxn-tabs { display: flex; flex: 1 1 auto; min-width: 0; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.nxn-tabs::-webkit-scrollbar { display: none; }
.nxn-tab { position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 0.35rem 0.6rem 0.5rem; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; color: #4b5563; cursor: pointer; transition: color .12s; }
.nxn-tab:hover { color: #111827; }
.dark .nxn-tab { color: #94a3b8; }
.dark .nxn-tab:hover { color: #ffffff; }
.nxn-tab[aria-selected="true"] { color: rgb(var(--b-700)); }
.nxn-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: rgb(var(--b-600)); }
.dark .nxn-tab[aria-selected="true"] { color: #ffffff; }
.dark .nxn-tab[aria-selected="true"]::after { background: rgb(var(--b-500)); }
.nxn-tab.is-inactive { opacity: .55; font-weight: 500; }
.nxn-tab-sep { align-self: center; flex-shrink: 0; margin: 0 4px 2px 6px; padding-inline-start: 10px; border-inline-start: 1px solid #e5e7eb; font-size: 0.6875rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #9ca3af; white-space: nowrap; }
.dark .nxn-tab-sep { border-color: #343842; color: #6b7280; }
.nxn-tabbar-pin { flex-shrink: 0; margin-bottom: 5px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; color: #6b7280; cursor: pointer; }
.nxn-tabbar-pin:hover { background: rgb(0 0 0 / .05); color: #111827; }
.dark .nxn-tabbar-pin { color: #94a3b8; }
.dark .nxn-tabbar-pin:hover { background: rgb(255 255 255 / .06); color: #ffffff; }
.nxn-tabbar-pin svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.nxn-tabbar-pin.is-on { color: rgb(var(--b-600)); }
.dark .nxn-tabbar-pin.is-on { color: rgb(var(--b-400)); }
@media (max-width: 639px) {
  .nxn-tabbar-area { display: none; }
  .nxn-tabbar-pin span { display: none; }
}

/* Search jump highlight */
.nxn-flash { animation: nxn-flash 1.6s ease-out 1; border-radius: 10px; }
@keyframes nxn-flash { 0%, 30% { box-shadow: 0 0 0 3px rgb(var(--b-500) / .4); } 100% { box-shadow: 0 0 0 3px rgb(var(--b-500) / 0); } }

@media (min-width: 1024px) {
  #admSidebar { position: sticky; top: 0; height: 100vh; }
  .nxn-tabbar { display: none !important; }
}

/* ============================================================================
   4. CLEAN UNDERLINE SUB-TABS (GitHub / Stripe Style)
   ============================================================================ */
.admin-subtabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px !important;
}
.dark .admin-subtabs-row {
  border-bottom-color: #2b2f38;
}
.admin-subtabs-row > .admin-subtabs {
  border-bottom: 0 !important;
  margin-bottom: 0 !important;
  width: auto !important;
  flex: 1 1 auto;
}
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100% !important;
  gap: 2px 4px !important;
  padding: 0 !important;
  margin-bottom: 12px !important;
  border: 0 !important;
  border-bottom: 1px solid #e5e7eb !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: none !important;
}
.dark .admin-subtabs {
  border-bottom-color: #2b2f38 !important;
  background: transparent !important;
}
.admin-subtabs::-webkit-scrollbar { display: none !important; }

.admin-subtabs > [role="tab"],
.admin-subtabs > [data-subtab-btn] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px 9px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3 !important;
  font-weight: 500;
  border-radius: 0 !important;
  background: transparent !important;
  color: #6b7280 !important;
  box-shadow: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s ease;
}
.admin-subtabs > [role="tab"] > svg,
.admin-subtabs > [data-subtab-btn] > svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  opacity: 0.78;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.admin-subtabs > [role="tab"]:hover > svg,
.admin-subtabs > [data-subtab-btn]:hover > svg,
.admin-subtabs > [role="tab"][aria-selected="true"] > svg,
.admin-subtabs > [data-subtab-btn][aria-selected="true"] > svg {
  opacity: 1;
}
.admin-subtabs > [role="tab"]:first-child,
.admin-subtabs > [data-subtab-btn]:first-child {
  padding-inline-start: 0 !important;
}
.dark .admin-subtabs > [role="tab"],
.dark .admin-subtabs > [data-subtab-btn] {
  color: #94a3b8 !important;
}
.admin-subtabs > [role="tab"]:hover,
.admin-subtabs > [data-subtab-btn]:hover {
  color: #111827 !important;
  background: transparent !important;
}
.dark .admin-subtabs > [role="tab"]:hover,
.dark .admin-subtabs > [data-subtab-btn]:hover {
  color: #ffffff !important;
  background: transparent !important;
}
.admin-subtabs > [role="tab"][aria-selected="true"],
.admin-subtabs > [data-subtab-btn][aria-selected="true"] {
  color: rgb(var(--b-700)) !important;
  font-weight: 600 !important;
  background: transparent !important;
}
.dark .admin-subtabs > [role="tab"][aria-selected="true"],
.dark .admin-subtabs > [data-subtab-btn][aria-selected="true"] {
  color: #ffffff !important;
}
.admin-subtabs > [role="tab"][aria-selected="true"]::after,
.admin-subtabs > [data-subtab-btn][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 11px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: rgb(var(--b-600));
}
.admin-subtabs > [role="tab"]:first-child[aria-selected="true"]::after,
.admin-subtabs > [data-subtab-btn]:first-child[aria-selected="true"]::after {
  inset-inline-start: 0;
}
.dark .admin-subtabs > [role="tab"][aria-selected="true"]::after,
.dark .admin-subtabs > [data-subtab-btn][aria-selected="true"]::after {
  background: rgb(var(--b-500));
}

.admin-subtabs-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  margin-inline-start: auto;
}

@media (max-width: 640px) {
  #admSidebar { width: min(86vw, 300px); }
  .admin-subtabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .admin-subtabs > [data-subtab-btn] {
    padding: 7px 10px 8px !important;
    flex-shrink: 0;
  }
}

/* ============================================================================
   5. COMPACT CARD SPACING & MULTI-COLUMN ACTION GRID (zero empty whitespace)
   ============================================================================ */
#admShell main .atab-panel > :not([hidden]):not(.subtab-hidden) ~ :not([hidden]):not(.subtab-hidden) {
  margin-top: 0.75rem !important;
}
#admShell main .ui-card {
  border-radius: 9px;
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dark #admShell main .ui-card {
  background-color: #1e2024;
  border-color: #2b2f38;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
#admShell main .ui-card.p-4,
#admShell main .ui-card.p-5,
#admShell main .ui-card.p-6 {
  padding: 0.85rem 1rem;
}
#admShell main .ui-card > .px-4.py-3,
#admShell main .ui-card > .px-4.py-3\.5,
#admShell main .ui-card > .px-5.py-3\.5,
#admShell main .ui-card > .px-5.py-4 {
  padding: 0.65rem 1rem;
}

/* Multi-column action tile grid (fills full width without stretching empty space between text & button) */
.nx-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.nx-doc-tile {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 0.95rem 1.05rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.dark .nx-doc-tile {
  background: #1e2024;
  border-color: #2b2f38;
}
.nx-doc-tile h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}
.dark .nx-doc-tile h3 {
  color: #f3f4f6;
}
.nx-doc-tile p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #6b7280;
}
.dark .nx-doc-tile p {
  color: #94a3b8;
}
.nx-doc-tile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef0f3;
}
.dark .nx-doc-tile-actions {
  border-top-color: #282c34;
}

/* ============================================================================
   6. TYPOGRAPHY HYGIENE: NO ALL-CAPS CARD TITLES, NO MISPLACED MONOSPACE
   ============================================================================ */
/* Calm, scannable sentence-case headings across all 44 panels */
#admShell main .ui-card h3.uppercase,
#admShell main .ui-card h4.uppercase,
#admShell main .nx-list-card h3.uppercase {
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  font-size: 0.9rem !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
}

/* UI Badges, Nav Pills, Selects & Numeric Inputs: Sans-Serif + tabular-nums (NEVER monospace prose) */
html[data-ui-scope="admin"] .ui-badge,
html[data-ui-scope="admin"] .ui-badge-emerald,
html[data-ui-scope="admin"] .ui-badge-amber,
html[data-ui-scope="admin"] .ui-badge-rose,
html[data-ui-scope="admin"] .ui-badge-blue,
html[data-ui-scope="admin"] .ui-badge-brand,
html[data-ui-scope="admin"] .ui-badge-slate,
html[data-ui-scope="admin"] .nav-pill,
html[data-ui-scope="admin"] .nav-pill-muted,
html[data-ui-scope="admin"] .nav-pill-emerald,
html[data-ui-scope="admin"] .nav-pill-amber,
html[data-ui-scope="admin"] .nav-pill-rose,
html[data-ui-scope="admin"] select.font-mono,
html[data-ui-scope="admin"] input[type="number"].font-mono {
  font-family: var(--nx-sans) !important;
  font-variant-numeric: tabular-nums;
}

/* Calm Event-Trace KPI Bar (fixes Image #1 rainbow monospace strip) */
.nx-kpi-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 9px 20px;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
  font-family: var(--nx-sans);
}
.dark .nx-kpi-bar {
  background: #191b1f;
  border-bottom-color: #282c34;
}
.nx-kpi-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.nx-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4b5563;
  white-space: nowrap;
}
.dark .nx-kpi-chip {
  background: #22252b;
  border-color: #2f333d;
  color: #cbd5e1;
}
.nx-kpi-chip strong {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: #111827;
}
.dark .nx-kpi-chip strong {
  color: #f8fafc;
}
.nx-kpi-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.nx-kpi-dot-slate { background: #64748b; }
.nx-kpi-dot-sky { background: #0284c7; }
.nx-kpi-dot-indigo { background: #4f46e5; }
.nx-kpi-dot-emerald { background: #16a34a; }
.nx-kpi-dot-amber { background: #d97706; }
.nx-kpi-dot-rose { background: #dc2626; }

/* Compact Overflow Menu (<details>) for secondary toolbar buttons */
.nx-more-menu {
  position: relative;
}
.nx-more-menu > summary {
  list-style: none;
}
.nx-more-menu > summary::-webkit-details-marker {
  display: none;
}
.nx-more-menu-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 196px;
  padding: 5px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dark .nx-more-menu-panel {
  background: #1e2024;
  border-color: #343842;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.nx-more-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}
.nx-more-menu-item:hover {
  background: #f3f4f6;
  color: #111827;
}
.dark .nx-more-menu-item {
  color: #d1d5db;
}
.dark .nx-more-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.nx-more-menu-sep {
  height: 1px;
  margin: 3px 4px;
  background: #eef0f3;
}
.dark .nx-more-menu-sep {
  background: #2b2f38;
}

/* Tabular numbers helper for timestamps & KPI counters */
.nx-tnum {
  font-family: var(--nx-sans);
  font-variant-numeric: tabular-nums;
}

.nx-dns-val {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}
.nx-dns-val.is-open {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}
