/* Device · Server */

.nw-ds-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.nw-ds-tabs a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--text);
  border: 1px solid var(--kpi-border, #ccc);
  background: transparent;
}

.nw-ds-tabs a.is-active {
  background: var(--accent, #c8102e);
  color: #fff;
  border-color: transparent;
}

.nw-ds-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  align-items: center;
}

.nw-ds-toolbar input[type="search"],
.nw-ds-toolbar select {
  min-width: 10rem;
  flex: 1 1 10rem;
}

.nw-ds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

.nw-ds-span2 {
  grid-column: 1 / -1;
}

.nw-ds-table {
  width: 100%;
  min-width: 72rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.nw-ds-table th,
.nw-ds-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--kpi-border, #ddd);
  vertical-align: top;
}

.nw-ds-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.nw-ds-pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .nw-ds-pill {
  background: rgba(255, 255, 255, 0.1);
}

.nw-ds-pill--active {
  background: rgba(46, 125, 50, 0.18);
}
.nw-ds-pill--planned,
.nw-ds-pill--draft {
  background: rgba(2, 136, 209, 0.15);
}
.nw-ds-pill--move,
.nw-ds-pill--maintenance {
  background: rgba(217, 119, 6, 0.18);
}
.nw-ds-pill--decommissioned,
.nw-ds-pill--rejected {
  background: rgba(198, 40, 40, 0.14);
}

.nw-ds-preview {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius, 8px);
  max-height: 14rem;
  overflow: auto;
}

html[data-theme="dark"] .nw-ds-preview {
  background: rgba(255, 255, 255, 0.05);
}

.nw-ds-party {
  display: grid;
  grid-template-columns: 8rem 1fr 1.4fr auto;
  gap: 0.4rem;
  margin: 0.4rem 0;
  align-items: center;
}

.nw-ds-check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}

.nw-ds-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.nw-ds-kv {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.nw-ds-kv dt {
  color: var(--text-muted);
}

.nw-ds-kv dd {
  margin: 0;
}

.nw-ds-thumb {
  width: 96px;
  height: 56px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--kpi-border, #ddd);
  border-radius: 4px;
  display: block;
  background: #111;
}

.nw-ds-thumb-cell {
  width: 104px;
}

.nw-ds-table-wrap {
  overflow-x: auto;
}

.nw-ds-table th[data-nw-ds-sort] {
  white-space: nowrap;
  vertical-align: middle;
}

.nw-ds-sort {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.nw-ds-sort:hover {
  color: var(--text, #111);
}

.nw-ds-table th[aria-sort="ascending"] .nw-ds-sort::after,
.nw-ds-table th[aria-sort="descending"] .nw-ds-sort::after {
  font-size: 0.7em;
  margin-left: 0.25rem;
  opacity: 0.75;
}

.nw-ds-table th[aria-sort="ascending"] .nw-ds-sort::after {
  content: "▲";
}

.nw-ds-table th[aria-sort="descending"] .nw-ds-sort::after {
  content: "▼";
}

.nw-ds-owner-cell {
  min-width: 10rem;
}

.nw-ds-inline {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.28rem;
  padding: 0.28rem 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  color: inherit;
  border: 1px solid var(--kpi-border, #ccc);
  border-radius: 4px;
  background: transparent;
}

.nw-ds-inline:last-child {
  margin-bottom: 0;
}

.nw-ds-inline:focus {
  outline: 2px solid var(--accent, #0ea5e9);
  outline-offset: 1px;
}

.nw-ds-inline.is-saving {
  opacity: 0.65;
}

.nw-ds-inline.is-saved {
  border-color: #2e7d32;
}

.nw-ds-inline.is-err {
  border-color: #c62828;
}

html[data-theme="dark"] .nw-ds-inline {
  background: rgba(255, 255, 255, 0.04);
}

.nw-ds-tag-cell {
  min-width: 12.5rem;
  width: 13.5rem;
}

.nw-ds-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.3rem;
}

.nw-ds-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  border: 1px solid var(--kpi-border, #ccc);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.nw-ds-tag__btn {
  margin: 0;
  padding: 0.15rem 0.35rem 0.15rem 0.45rem;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.nw-ds-tag__x {
  margin: 0;
  padding: 0 0.35rem 0 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
}

.nw-ds-tag__x:hover {
  opacity: 1;
}

.nw-ds-tag-add {
  min-width: 7rem;
}

@media (max-width: 720px) {
  .nw-ds-grid,
  .nw-ds-party {
    grid-template-columns: 1fr;
  }
}
