
/* Step 59: Admin diagnostics */
body.nik59-lock {
  overflow: hidden !important;
}

#nik59-diagnostics,
#nik59-diagnostics * {
  box-sizing: border-box;
}

#nik59-diagnostics {
  position: fixed;
  inset: 0;
  z-index: 6500;
  display: none;
  color: #0f172a;
}

#nik59-diagnostics.is-open {
  display: block;
}

.nik59-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nik59-shell {
  position: absolute;
  inset: 18px;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border: 1px solid rgba(125, 180, 255, .30);
  border-radius: 32px;
  background:
    radial-gradient(circle at 12% 8%, rgba(186, 230, 253, .48), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(125, 211, 252, .24), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(239,248,255,.82));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 42px 120px rgba(15, 23, 42, .30), inset 0 1px 0 rgba(255,255,255,.86);
  overflow: hidden;
}

.nik59-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(125, 180, 255, .20);
}

.nik59-eyebrow {
  display: inline-flex;
  border: 1px solid rgba(14, 165, 233, .22);
  border-radius: 999px;
  background: rgba(224, 242, 254, .74);
  color: #0369a1;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nik59-header h2 {
  margin: 12px 0 0;
  color: #0f172a;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.nik59-header p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #52657c;
  font-size: 14px;
  line-height: 1.6;
}

.nik59-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nik59-btn,
.nik59-close {
  min-height: 44px;
  border: 1px solid rgba(125, 180, 255, .24);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  padding: 0 14px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.nik59-close {
  width: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.nik59-btn:hover,
.nik59-close:hover {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.40);
  background: rgba(240,249,255,.90);
}

.nik59-storage {
  margin: 16px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(125, 180, 255, .22);
  border-radius: 22px;
  background: rgba(255,255,255,.66);
  padding: 14px;
}

.nik59-storage b {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.nik59-storage span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.nik59-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 24px 10px;
}

.nik59-tabs button {
  min-height: 42px;
  border: 1px solid rgba(125, 180, 255, .22);
  border-radius: 15px;
  background: rgba(255,255,255,.64);
  color: #334155;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.nik59-tabs button:hover,
.nik59-tabs button.is-active {
  transform: translateY(-1px);
  border-color: rgba(14,165,233,.38);
  background: linear-gradient(135deg, rgba(37,99,235,.92), rgba(14,165,233,.86));
  color: #fff;
}

.nik59-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0 24px 24px;
  border: 1px solid rgba(125, 180, 255, .22);
  border-radius: 26px;
  background: rgba(255,255,255,.58);
  padding: 16px;
}

.nik59-loading,
.nik59-empty {
  margin: 24px;
  border: 1px dashed rgba(125, 180, 255, .36);
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  padding: 28px;
  color: #52657c;
  text-align: center;
  font-size: 14px;
}

.nik59-empty.good {
  border-color: rgba(16,185,129,.26);
  background: rgba(236,253,245,.72);
  color: #047857;
}

.nik59-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

.nik59-stat {
  border: 1px solid rgba(125, 180, 255, .22);
  border-radius: 20px;
  background: rgba(255,255,255,.70);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.76);
}

.nik59-stat b {
  display: block;
  color: #0f172a;
  font-size: 26px;
  line-height: 1;
}

.nik59-stat span {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.nik59-stat small {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 11px;
}

.nik59-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 14px;
}

.nik59-card {
  border: 1px solid rgba(125,180,255,.20);
  border-radius: 22px;
  background: rgba(255,255,255,.68);
  padding: 14px;
}

.nik59-card h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.nik59-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(148,163,184,.18);
  padding: 9px 0;
  color: #475569;
  font-size: 13px;
}

.nik59-row:first-of-type {
  border-top: 0;
}

.nik59-row b {
  color: #0f172a;
}

.nik59-muted {
  color: #64748b;
  font-size: 13px;
}

.nik59-search {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(125,180,255,.28);
  border-radius: 17px;
  background: rgba(255,255,255,.76);
  color: #0f172a;
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  margin-bottom: 12px;
}

.nik59-search:focus {
  border-color: rgba(14,165,233,.58);
  box-shadow: 0 0 0 4px rgba(186,230,253,.55);
}

.nik59-table {
  display: grid;
  gap: 10px;
}

.nik59-list-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  border: 1px solid rgba(125,180,255,.20);
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  padding: 14px;
}

.nik59-list-item.warning {
  border-color: rgba(251,113,133,.24);
  background: rgba(255,241,242,.72);
}

.nik59-list-item h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.25;
}

.nik59-list-item p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.nik59-list-item details {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(148,163,184,.18);
  padding-top: 10px;
}

.nik59-list-item summary {
  color: #0369a1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.nik59-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 7px;
}

.nik59-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: rgba(241,245,249,.92);
  color: #475569;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.nik59-badge.info {
  background: rgba(224,242,254,.88);
  color: #0369a1;
}

.nik59-badge.success {
  background: rgba(220,252,231,.88);
  color: #047857;
}

.nik59-badge.danger {
  background: rgba(255,228,230,.90);
  color: #be123c;
}

.nik59-badge.muted {
  background: rgba(241,245,249,.92);
  color: #64748b;
}

.nik59-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.nik59-chip-list span {
  border: 1px solid rgba(125,180,255,.20);
  border-radius: 999px;
  background: rgba(240,249,255,.74);
  color: #075985;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
}

#nik59-diagnostics-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 6600;
  display: none;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(125,211,252,.45);
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(15,23,42,.18);
  color: #0f172a;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
}

#nik59-diagnostics-toast.is-visible {
  display: block;
}

.nik59-admin-nav-button {
  border-color: rgba(14,165,233,.32) !important;
  background: rgba(240,249,255,.74) !important;
}

@media (max-width: 900px) {
  .nik59-shell {
    inset: 8px;
    border-radius: 24px;
  }

  .nik59-header {
    flex-direction: column;
    padding: 18px;
  }

  .nik59-storage {
    margin: 12px 18px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .nik59-tabs {
    padding: 12px 18px 8px;
  }

  .nik59-panel {
    margin: 0 18px 18px;
  }

  .nik59-stats-grid,
  .nik59-two-col {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .nik59-list-item {
    grid-template-columns: 1fr;
  }

  .nik59-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .nik59-stats-grid,
  .nik59-two-col {
    grid-template-columns: 1fr;
  }

  .nik59-header-actions {
    width: 100%;
  }

  .nik59-btn {
    flex: 1;
  }
}
