/* Zentrale Abfragen — /tools/abfrage.html (ergänzt app.css + admin.css) */

.nw-qry-widget {
  max-width: 56rem;
}

.nw-qry-out {
  margin-top: 1rem;
  width: 100%;
  max-width: none;
}

.nw-qry-out .nw-dt.nw-dt--ag {
  width: 100%;
  max-width: none;
}

.nw-qry-form__row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(7rem, 0.55fr) minmax(14rem, 1.4fr);
  gap: 0.85rem 1rem;
  align-items: end;
}

@media (max-width: 640px) {
  .nw-qry-form__row {
    grid-template-columns: 1fr;
  }
}

.nw-qry-form__row:has(#nw-qry-days-wrap[hidden]) {
  grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1.4fr);
}

.nw-qry-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

.nw-qry-field input[type="search"],
.nw-qry-field input[type="text"],
.nw-qry-field input[type="number"],
.nw-qry-field select,
.nw-qry-bulk {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 0.9rem;
}

.nw-qry-bulk {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
  min-height: 8rem;
}

.nw-qry-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--text-muted);
}

.nw-qry-combo {
  position: relative;
}

.nw-qry-combo__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.nw-qry-combo__btn:hover {
  border-color: var(--accent);
}

.nw-qry-combo__chev {
  opacity: 0.65;
  font-size: 0.75rem;
}

.nw-qry-combo__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.nw-qry-combo__filter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
  background: var(--bg-page);
  color: var(--input-text);
}

.nw-qry-combo__list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 14rem;
  overflow: auto;
}

.nw-qry-combo__opt {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}

.nw-qry-combo__opt:hover,
.nw-qry-combo__opt.is-active {
  background: var(--icon-btn-hover-bg, rgba(0, 0, 0, 0.06));
}

.nw-qry-combo__opt[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.nw-qry-hint {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 1.2em;
}

.nw-qry-gate {
  margin: 0 0 0.75rem;
}

.nw-qry-status {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.nw-qry-status--err {
  color: var(--danger, #c62828);
}

.nw-qry-progress-wrap {
  margin: 0.35rem 0 0.85rem;
  max-width: 28rem;
}

.nw-qry-progress {
  position: relative;
  height: 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #00a0c8) 18%, var(--border, #d0d5dd));
}

.nw-qry-progress__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  border-radius: inherit;
  background: var(--accent, #00a0c8);
  animation: nw-qry-progress-slide 1.1s ease-in-out infinite;
}

@keyframes nw-qry-progress-slide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nw-qry-progress__bar {
    left: 0;
    width: 100%;
    opacity: 0.55;
    animation: none;
  }
}

.nw-qry-out__summary {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

.nw-qry-out__actions {
  margin: 0.75rem 0;
}

.nw-qry-dns-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.nw-qry-dns-tile {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  font-size: 0.82rem;
}

.nw-qry-dns-tile__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.nw-qry-warn {
  color: var(--warn, #856404);
}

.nw-qry-pre {
  margin: 0;
  padding: 0.65rem 0.75rem;
  max-height: 28rem;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.nw-qry-table-host {
  margin-top: 0.35rem;
  width: 100%;
  max-width: none;
}

/* Device-Seite: kompakte Suche */
.nw-qry-widget--device {
  max-width: none;
}

.nw-qry-form--device .nw-qry-form__row--device {
  grid-template-columns: 1fr;
  align-items: center;
}

.nw-qry-q-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.nw-qry-q-inline input[type="search"] {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.nw-qry-q-aside {
  flex: 0 0 auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.nw-qry-form--device .nw-qry-hint[hidden] {
  display: none !important;
}

.nw-dt__expand-row > td {
  padding: 0.55rem 0.65rem 0.7rem;
  background: var(--bg-page, var(--nw-dt-row-even));
  border-bottom: 1px solid var(--nw-dt-border);
  vertical-align: top;
}

.nw-dt__expand-head {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Separate ISE-Auth-Tabelle unter Device-Suche */
.nw-qry-auth-panel {
  margin-top: 1.1rem;
  width: 100%;
}

.nw-qry-auth-panel[hidden] {
  display: none !important;
}

.nw-qry-auth-panel__status,
.nw-qry-auth-panel__empty {
  margin: 0.35rem 0 0;
}

.nw-qry-auth-table-host {
  margin-top: 0.25rem;
}

.nw-qry-drawer-auth {
  padding: 0.35rem 0.45rem 0.55rem;
}

.nw-qry-drawer-auth__table {
  font-size: 0.75rem;
}

.nw-qry-drawer-auth__table thead th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 0.25rem 0.35rem 0.35rem 0;
  border-bottom: 1px solid var(--nw-dt-border, var(--border));
}

.nw-qry-drawer-auth__table td {
  vertical-align: top;
  padding: 0.28rem 0.4rem 0.28rem 0;
  font-weight: 400;
}

.nw-qry-ise-auth-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.nw-qry-ise-auth-table {
  width: max-content;
  max-width: none;
  table-layout: auto;
  border-collapse: collapse;
  margin: 0;
}

.nw-qry-ise-auth-table th,
.nw-qry-ise-auth-table td {
  width: auto;
  white-space: nowrap;
  box-sizing: border-box;
}

.nw-dt--ise-auth .nw-dt__title {
  color: var(--text);
}

.nw-qry-group-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-family: var(--nw-dt-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.72rem;
  line-height: 1.35;
  word-break: break-word;
}

.nw-qry-group-badge--ok {
  background: color-mix(in srgb, #1b8a4a 22%, transparent);
  color: #0f5c30;
  border: 1px solid color-mix(in srgb, #1b8a4a 45%, transparent);
}

.nw-qry-group-badge--warn {
  background: color-mix(in srgb, #e67e22 28%, transparent);
  color: #8a4b00;
  border: 1px solid color-mix(in srgb, #e67e22 50%, transparent);
}

html[data-theme="dark"] .nw-qry-group-badge--ok {
  background: color-mix(in srgb, #3dd68c 28%, transparent);
  color: #b8f0d0;
  border-color: color-mix(in srgb, #3dd68c 45%, transparent);
}

html[data-theme="dark"] .nw-qry-group-badge--warn {
  background: color-mix(in srgb, #f0a060 30%, transparent);
  color: #ffd8b0;
  border-color: color-mix(in srgb, #f0a060 50%, transparent);
}

.nw-dt__cell-copy-flash {
  outline: 2px solid var(--accent, #0d9488);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent, #0d9488) 16%, transparent);
}

.nw-dt-copy-toast {
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: var(--text, #1a1a1a);
  color: var(--bg-page, #fff);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nw-dt-copy-toast.is-on {
  opacity: 1;
}

.nw-qry-field--source {
  margin-top: 0.35rem;
}

.nw-qry-source__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.nw-qry-source {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nw-qry-source__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--bg-card, transparent);
}

.nw-qry-source__opt:has(input:checked) {
  border-color: var(--accent, #0056a3);
  background: color-mix(in srgb, var(--accent, #0056a3) 12%, transparent);
  font-weight: 600;
}

.nw-qry-lockout__summary {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.nw-qry-lockout__summary.is-locked {
  color: var(--danger, #b42318);
}

.nw-qry-lockout__summary.is-disabled {
  color: var(--text-muted);
}

.nw-qry-lockout__issues {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  color: var(--danger, #b42318);
}

.nw-qry-lockout__diag {
  margin: 0 0 0.65rem;
  width: 100%;
}

.nw-qry-lockout__scroll {
  overflow-x: auto;
  margin: 0 -0.15rem;
}

.nw-qry-lockout__table {
  min-width: 56rem;
}

.nw-qry-lockout__table th,
.nw-qry-lockout__table td {
  white-space: nowrap;
}

.nw-qry-lockout__sources {
  margin: 0.7rem 0 0.85rem;
}

.nw-qry-lockout__sources-title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.nw-qry-lockout__sources-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nw-qry-lockout__table tr.is-locked td {
  background: color-mix(in srgb, var(--danger, #b42318) 10%, transparent);
}

.nw-qry-lockout__table tr.is-disabled td {
  color: var(--text-muted);
}

.nw-qry-lockout__table tr.is-err td {
  color: var(--danger, #b42318);
}
