/* Override Bootstrap text-secondary for dark theme readability */
.text-secondary {
  color: #b5bdca !important;
}

.databox {
  max-height: 55vh;
  overflow-y: auto;
}

#pagination .btn:disabled,
#pagination .btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.separator {
  border-bottom: 1px solid lightgray;
  margin: 0.5rem 2rem;
}

.bg-eQ-grey {
  background-color: rgb(31, 31, 31);
}

.bg-eQ-light {
  background-color: rgb(209, 209, 209);
}



.clickable:hover {
  font-weight: bold;
  background-color: rgba(211, 211, 211, 0.137);
}

p {
  margin: 0;
  padding: 0;
}

.fs-7 {
  font-size: 0.8rem;
}

.fs-8 {
  font-size: 0.7rem;
}

.w-fit {
  width: fit-content;
}

.w-20 {
  width: 20%;
}

.w-30 {
  width: 30%;
}

.w-40 {
  width: 40%;
}

.w-45 {
  width: 45%;
}

.w-60 {
  width: 60%;
}

.w-70 {
  width: 70%
}

.w-80 {
  width: 80%
}

.w-90 {
  width: 90%
}

.w-3em {
  width: 3em;
}

.w-3rem {
  width: 3rem;
}

.w-4rem {
  width: 4rem;
}

.w-5rem {
  width: 5rem;
}

.w-6rem {
  width: 6rem;
}

.w-8rem {
  width: 8rem;
}

.w-10em {
  width: 10em;
}

.w-10rem {
  width: 10rem;
}

.w-20em {
  width: 20em;
}

.w-30em {
  min-width: 30em;
}

.w-30rem {
  width: 30rem;
}

.h-sm {
  height: 1.5rem;
}

.h-2rem {
  height: 2rem;
}

.pos-relative {
  position: relative;
}

.bg-eQdark {
  background-color: rgb(33, 37, 41);
}

.bg-header {
  background-color: var(--bs-light);
  color: black;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0 0px
}

.bg-asset-present {
  color: var(--bs-light);
  font-weight: normal;
  background-color: rgba(0, 35, 0, 0.2);
  border: 1px solid rgba(0, 128, 0, 0.4);
  padding: 0 0px
}

.bg-asset-missing {
  color: var(--bs-light);
  font-weight: normal;
  background-color: rgba(255, 0, 0, .15);
  border: 1px solid rgba(255, 0, 0, .2);
  padding: 0 0px
}

.bg-asset-all {
  color: var(--bs-light);
  font-weight: normal;
  background-color: rgb(33, 37, 41);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0 0px
}

.bg-asset-recent {
  color: var(--bs-light);
  font-weight: normal;
  background-color: rgb(0, 26, 255, 0.01);
  border: 1px solid rgb(0, 26, 255, 0.01);
  padding: 0 0px
}

.flex-row-free {
  display: flex;
  flex-flow: row wrap;
}

.flex-col-free {
  display: flex;
  flex-flow: column wrap;
}

.flex-gap-1 {
  gap: 1em 1em;
}

.text-nowrap {
  white-space: nowrap;
}

.searchbox {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  visibility: hidden;
  background-color: white;
  color: black;
  font-size: .9em;
  border: 1px solid rgb(0, 0, 0);
  border-radius: 10px;
  top: 3em;
  left: 2rem;
  width: 100%;
  max-width: 90%;
  min-height: 25vh;
  position: absolute;
  overflow: scroll;
  z-index: 1502;
}

.searchbox .sb-list {
  min-height: 20vh;
  max-height: 45vh;
  overflow-y: visible;
}


.searchbox li {
  padding: 3px;
  border-bottom: 1px solid rgb(190, 190, 190);
}

.searchbox ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Compact tag search dropdown, used on the asset edit and register-tag pages */
#tagbox {
  min-height: auto;
  max-height: 30vh;
}

#tagbox .sb-list {
  min-height: auto;
  max-height: 20vh;
}

input {
  border-radius: 3px;
  border: none;
}

input:focus {
  outline: 6px solid rgba(126, 182, 255, 0.616);
}

input[type="checkbox"] {
  transform: scale(1.3);
  margin-left: .2em;
}

.cmodal {
  display: none;
  border: none;
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1500;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.6);
}

/* The standard JS-built dialog panel: fill the width its own max-width allows.
   Every such modal repeated "width:100%" inline next to its max-width.
   Deliberately not on .cmodal-content itself — the modals declared in the .html
   pages set no max-width and size to their content, so a width there would
   stretch them across the whole viewport. Each panel still sets its own
   max-width inline, since that is the part that genuinely differs. */
.cmodal-panel {
  width: 100%;
}

#regtagbut {
  z-index: 1501;
}



#datacontainer::-webkit-scrollbar {
  width: 1rem;
  background-color: grey;
}

#datacontainer::-webkit-scrollbar-track {
  background-color: var(--bs-dark);
  box-shadow: inset 0 0 6px #F5F5F5;
  width: 1rem;
}

#datacontainer::-webkit-scrollbar-thumb {
  background-color: lightgrey;
  border-radius: .3rem;
  border: 2px solid black;
}

/* Typeahead dropdown shared by several pages' asset search boxes (asset edit,
   register-tag, shell top-bar search, and others) — not specific to one page. */
.ae-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background-color: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 400px;
}

.ae-dropdown-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ae-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  color: #333;
}

.ae-dropdown-item:hover {
  background-color: #e9ecef;
}

.ae-dropdown-item:last-child {
  border-bottom: none;
}

.ae-item-uid {
  font-weight: 600;
  font-size: 0.85rem;
  color: #212529;
}

.ae-item-detail {
  font-size: 0.72rem;
  color: #6c757d;
}

.ae-dropdown-empty {
  padding: 0.5rem 0.75rem;
  color: #999;
  font-size: 0.8rem;
  font-style: italic;
}

.ae-dropdown-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid #ddd;
  background-color: #f8f9fa;
  border-radius: 0 0 6px 6px;
}

#filtersidebar .form-select,
#filtersidebar .form-control {
  background-color: #2b3035;
  color: #c9cdd3;
  border-color: rgba(255, 255, 255, 0.12);
}

#filtersidebar .form-select:focus,
#filtersidebar .form-control:focus {
  background-color: #2b3035;
  color: #e5e7eb;
  border-color: rgba(126, 182, 255, 0.5);
}

#filtersidebar .input-group-text {
  background-color: #373d44;
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-tabs .nav-link {
  color: #9ca3af;
  border-color: transparent;
}

.nav-tabs .nav-link:hover {
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) transparent;
}

.nav-tabs .nav-link.active {
  color: #fff !important;
  background-color: #1a1d21;
  border-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.15) #1a1d21;
}

.dashboard-stats-row>[class*="col-"] {
  display: flex;
}

.dashboard-stats-row .dash-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sparkline-svg {
  display: block;
  width: 100%;
  margin-top: auto;
}

.sparkline-line {
  fill: none;
  stroke: #c084fc;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-fill {
  fill: url(#sparkGrad);
  opacity: 0.3;
}

.dash-panel {
  background-color: #1a1d21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.dash-row {
  display: grid;
  /* First column holds the tracking icons: a BLE tag and a QR sticker can both
     be present, so it fits two 26px badges side by side. */
  grid-template-columns: 58px 1fr 1fr 1fr 1fr 1.4fr 0.7fr 1fr 90px;
  align-items: center;
  gap: 0;
  min-height: 2.4rem;
  padding: 0 0.5rem;
}

/* Row density preferences — override .dash-row min-height and .dash-cell padding */
body.row-compact .dash-row { min-height: 1.7rem; }
body.row-compact .dash-row-header { min-height: 1.6rem; }
body.row-compact .dash-cell { padding: 0.15rem 0.4rem; }
body.row-compact .dash-header .dash-cell { padding: 0.25rem 0.4rem; }

body.row-comfortable .dash-row { min-height: 3rem; }
body.row-comfortable .dash-row-header { min-height: 2.6rem; }
body.row-comfortable .dash-cell { padding: 0.6rem 0.4rem; }
body.row-comfortable .dash-header .dash-cell { padding: 0.65rem 0.4rem; }

.dash-row-header {
  min-height: 2.2rem;
}

.dash-header {
  background-color: #23272b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px 6px 0 0;
}

.dash-header .dash-cell {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b919a;
  padding: 0.45rem 0.4rem;
  white-space: nowrap;
  user-select: none;
}

.dash-header .sortable {
  cursor: pointer;
}

.dash-header .sortable:hover {
  color: #c9cdd3;
}

.sort-icon {
  font-size: 0.55rem;
  margin-left: 2px;
  vertical-align: middle;
}

.dash-row-data {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s;
}

.dash-row-data:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dash-row-data:last-child {
  border-bottom: none;
}

.dash-cell {
  font-size: 0.8rem;
  color: #cfd3d8;
  padding: 0.35rem 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-cell-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  line-height: 1.2;
}

.dash-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.dash-icon-present {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.dash-icon-missing {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.dash-icon-default {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.dash-icon-ble {
  background-color: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.dash-icon-qr {
  background-color: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

/* An asset can be tracked by tag, by sticker, or by both, so the icons sit in
   a row inside the (column-stacked) icon cell rather than under each other. */
.dash-icon-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.dash-icon-notag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
  color: rgba(180, 60, 60, 0.65);
}

/* Asset cell (stacked uid + tagid) */
.dash-cell-asset {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.3;
}

.dash-primary {
  font-weight: 600;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.dash-secondary {
  font-size: 0.68rem;
  color: #6b7280;
}

.dash-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.dash-badge-present {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.dash-badge-missing {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* No Coverage: the asset's last gateway is offline, so its position is unknown
   rather than the asset being unaccounted for. Deliberately not red — the action
   is to fix the gateway, not to go looking for the asset. Violet because amber
   is already the untagged badge. */
.dash-badge-nocoverage {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.dash-badge-unknown {
  background-color: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.dash-badge-waiting {
  background-color: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.dash-badge-untagged {
  background-color: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.dash-badge-inactive {
  background-color: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.dash-filterbar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-filter-input {
  background-color: #2a2d31 !important;
  color: #e5e7eb !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.dash-filter-input::placeholder {
  color: #6b7280 !important;
  opacity: 1;
}

/* Location filter tree */
.locf-site, .locf-area, .locf-zone {
  padding: 0.15rem 0;
}

.locf-area {
  padding-left: 1.2rem;
}

.locf-zone {
  padding-left: 2.4rem;
}

.locf-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.locf-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.locf-toggle {
  width: 0.9rem;
  text-align: center;
  font-size: 0.6rem;
  color: #6b7280;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.locf-toggle.open {
  transform: rotate(90deg);
}

.locf-toggle.empty {
  visibility: hidden;
}

.locf-children.collapsed {
  display: none;
}

.locf-label {
  flex: 1;
  color: #d1d5db;
}

.locf-check {
  flex-shrink: 0;
}

.dash-filter-input:focus {
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}

.dash-filter-addon {
  background-color: #2a2d31;
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Selects in a filter bar sat at Bootstrap's white default next to a dark
   search box. Matched to .dash-filter-input rather than given their own tone,
   and scoped to the bar so every page carrying one is fixed at once. */
.dash-filterbar .form-select {
  background-color: #2a2d31;
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.15);
  /* Bootstrap's caret is a dark-stroked SVG, invisible against this. */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.dash-filterbar .form-select:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* The open list is drawn by the OS, which does not inherit the control's
   colours on Windows — without this the options revert to white. */
.dash-filterbar .form-select option {
  background-color: #2a2d31;
  color: #e5e7eb;
}

.dash-footer {
  background-color: #23272b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 6px 6px;
  padding: 0.35rem 0.75rem;
}

@media (max-width: 992px) {
  .dash-row {
    grid-template-columns: 50px 1fr 1fr 1fr 80px;
    font-size: 0.65rem;
  }

  .dash-cell-created,
  .dash-cell-ageing,
  .dash-cell-owner,
  .dash-cell-location {
    display: none;
  }
}

.loc-tree {
  padding: 0;
}

.loc-node {
  margin-left: 1.8rem;
}

.loc-node-root {
  margin-left: 0;
}

.loc-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  color: #d1d5db;
  transition: background-color 0.1s;
}

.loc-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.loc-toggle {
  width: 1rem;
  text-align: center;
  font-size: 0.65rem;
  color: #6b7280;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.loc-toggle.open {
  transform: rotate(90deg);
}

.loc-toggle.empty {
  visibility: hidden;
}

.loc-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
}

.loc-icon-site {
  color: #60a5fa;
}

.loc-icon-area {
  color: #34d399;
}

.loc-icon-zone {
  color: #fbbf24;
}

.loc-icon-gw {
  color: #a78bfa;
}

.loc-icon-unassigned {
  color: #6b7280;
}

.loc-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-badge {
  font-size: 0.6rem;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
  white-space: nowrap;
}

.loc-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.loc-row:hover .loc-actions {
  opacity: 1;
}

.loc-btn {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
  cursor: pointer;
  white-space: nowrap;
}

.loc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

.loc-children {
  overflow: hidden;
}

.loc-children.collapsed {
  display: none;
}

.loc-gw-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  margin-left: 1.8rem;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #9ca3af;
  transition: background-color 0.1s;
}

.loc-gw-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.loc-gw-name {
  color: #d1d5db;
  font-weight: 500;
}

.loc-gw-mac {
  font-size: 0.68rem;
  color: #6b7280;
}

.loc-gw-move {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}

.loc-gw-row:hover .loc-gw-move {
  opacity: 1;
}

.loc-gw-row[draggable="true"] {
  cursor: grab;
}

.loc-gw-row.dragging {
  opacity: 0.4;
}

.loc-row.drop-target {
  outline: 2px dashed rgba(96, 165, 250, 0.5);
  outline-offset: -2px;
  background: rgba(96, 165, 250, 0.08);
}

.loc-gw-row.loc-changed {
  border-left: 3px solid #fbbf24;
  padding-left: calc(0.5rem - 3px);
}

/* Save/Discard bar */
.loc-changebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  margin: -0.75rem -0.75rem 0.75rem -0.75rem;
  background: rgba(251, 191, 36, 0.1);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px 6px 0 0;
  font-size: 0.8rem;
  color: #fbbf24;
}

.loc-changebar .btn {
  font-size: 0.75rem;
}

.loc-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 0.8rem 0 0.3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0.8rem;
}

.am-row {
  grid-template-columns: 62px 1.1fr 1.3fr 1fr 0.9fr 0.8fr 0.6fr 0.9fr 90px;
}

.am-cell-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  line-height: 1.2;
}

.am-cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.am-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.15s;
  padding: 0;
}

.am-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

.am-action-btn.am-act-view:hover {
  color: #60a5fa;
}

.am-action-btn.am-act-edit:hover {
  color: #fbbf24;
}

.am-action-btn.am-act-deactivate:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.am-active-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
}

.am-active-yes {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.am-active-no {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Asset Edit Modal (dark themed) */
.asset-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1400;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
  overflow-y: auto;
}

.asset-modal-dialog {
  background-color: #1a1d21;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  color: #e5e7eb;
}

.am-input-label {
  background-color: #2b3035;
  color: #9ca3af;
  border-color: rgba(255, 255, 255, 0.12);
  min-width: 5.5rem;
  font-size: 0.8rem;
}

.am-input {
  background-color: #1f2328 !important;
  color: #e5e7eb !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  font-size: 0.85rem !important;
}

.am-input:focus {
  background-color: #252a30 !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
  color: #f3f4f6 !important;
}

.am-input::placeholder {
  color: #6b7280 !important;
}

.am-input:disabled {
  background-color: #161a1e !important;
  color: #6b7280 !important;
}

.separator-dark {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
}

/* Modal tag search dropdown */
.am-tag-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1450;
  background: #2b3035;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
}

.am-tag-item {
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #d1d5db;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.am-tag-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.am-tag-item:last-child {
  border-bottom: none;
}

.am-tag-item.am-tag-linked {
  color: #ef4444;
  font-style: italic;
}

@media (max-width: 992px) {
  .am-row {
    grid-template-columns: 54px 1fr 1fr 0.6fr 80px;
  }

  .am-cell-label,
  .am-cell-type,
  .am-cell-created,
  .am-cell-owner {
    display: none;
  }
}

.tm-row {
  grid-template-columns: 40px 1fr 1.1fr 1fr 1fr 0.9fr 0.6fr 0.7fr 0.7fr 90px;
}

/* Tag types registry */
.tt-row {
  grid-template-columns: 1fr 0.9fr 0.6fr 1fr 1.4fr 0.5fr 0.5fr 0.6fr 80px;
}

.tt-uncal {
  color: #6b7280;
  font-style: italic;
}

@media (max-width: 992px) {
  .tt-row {
    grid-template-columns: 1fr 0.6fr 80px;
  }

  .tt-cell-format,
  .tt-cell-supplier,
  .tt-cell-battery,
  .tt-cell-b0,
  .tt-cell-b100,
  .tt-cell-active {
    display: none;
  }
}

.tm-cell-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}

.tm-link-icon {
  font-size: 0.85rem;
  cursor: default;
}

.tm-link-linked {
  color: #22c55e;
}

.tm-link-unlinked {
  color: rgba(180, 60, 60, 0.65);
}

/* Battery column. The beacon reports a raw byte that can exceed 100, so the
   number rendered here is clamped in tags.js; the tooltip keeps the original. */
.tm-batt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.tm-batt i {
  font-size: 0.9rem;
}

.tm-batt-ok {
  color: #4ade80;
}

.tm-batt-warn {
  color: #fbbf24;
}

.tm-batt-low {
  color: #f87171;
}

.tm-batt-none {
  color: #6b7280;
}

/* A reading nobody has refreshed in over a day is still shown, but dimmed: the
   tag may simply be out of coverage, and a confident percentage would be a lie
   about how current it is. */
.tm-batt-stale {
  opacity: 0.45;
}

/* Device facts in the tag history modal */
.tm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  padding: 0 0.5rem 0.6rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
}

.tm-meta-label {
  color: #8b919a;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  margin-right: 0.35rem;
}

.tm-meta-value {
  color: #cfd3d8;
}

/* Tag history modal table */
.tm-history-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
}

.tm-history-table th {
  color: #8b919a;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tm-history-table td {
  padding: 0.35rem 0.5rem;
  color: #cfd3d8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tm-asset-link {
  color: #7dd3fc;
  text-decoration: none;
}

.tm-asset-link:hover {
  color: #bae6fd;
  text-decoration: underline;
}

.tm-history-linked {
  color: #4ade80;
}

.tm-history-delinked {
  color: #f87171;
}

@media (max-width: 992px) {
  .tm-row {
    grid-template-columns: 30px 1fr 1fr 0.6fr 80px;
  }

  .tm-cell-name,
  .tm-cell-desc,
  .tm-cell-enrolled,
  .tm-cell-btype,
  .tm-cell-batt {
    display: none;
  }
}

.gw-row {
  grid-template-columns: 1.1fr 1fr 1fr 0.8fr 1.4fr 0.7fr 0.9fr 80px;
}

.gw-toggle-active {
  color: #22c55e !important;
}

.gw-toggle-active:hover {
  color: #16a34a !important;
  background: rgba(34, 197, 94, 0.1);
}

.gw-toggle-inactive {
  color: #ef4444 !important;
}

.gw-toggle-inactive:hover {
  color: #dc2626 !important;
  background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 992px) {
  .gw-row {
    grid-template-columns: 1fr 1fr 0.6fr 80px;
  }

  .gw-cell-desc,
  .gw-cell-location {
    display: none;
  }
}

/* The page used the default .dash-row template, which is cut for nine columns
   and left its six landing on the wrong widths — the code column inherited the
   58px icon slot. This sizes the seven it actually has. */
.qr-row {
  grid-template-columns: 0.8fr 0.7fr 1fr 1.4fr 0.8fr 0.7fr 150px;
}

/* Ref is the column a phone user is looking for, so the UUID and the label are
   the ones that go when there is no room for all seven. */
@media (max-width: 992px) {
  .qr-row {
    grid-template-columns: 0.9fr 1.4fr 0.8fr 120px;
  }

  .qr-cell-code,
  .qr-cell-label,
  .qr-cell-created {
    display: none;
  }
}

.ow-row {
  grid-template-columns: 1.2fr 1.2fr 1.5fr 1fr 80px;
}

.pt-row {
  grid-template-columns: 1.2fr 1.5fr 1fr 1.5fr 80px;
}

.ap-container {
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.ap-row {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ap-row:last-child {
  border-bottom: none;
}

.ap-partno {
  flex: 1;
  color: #e5e7eb;
}

.ap-qty {
  width: 60px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #e5e7eb;
  font-size: 0.75rem;
  padding: 0.1rem 0.25rem;
}

.ap-remove {
  width: 24px;
  text-align: center;
  cursor: pointer;
  color: #ef4444;
  opacity: 0.6;
  margin-left: 0.25rem;
}

.ap-remove:hover {
  opacity: 1;
}

.ap-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #1e2126;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 6px 6px;
  max-height: 180px;
  overflow-y: auto;
}

.ap-dropdown-item {
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ap-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ap-dropdown-create {
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #22c55e;
  font-style: italic;
}

.ap-dropdown-create:hover {
  background: rgba(34, 197, 94, 0.1);
}

.fi-field-card {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.15s;
}

.fi-field-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.fi-field-card.mapped {
  border-color: #198754;
  background: rgba(25, 135, 84, 0.1);
  color: #a3e4b8;
}

.fi-field-card.selected {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.1);
}

.fi-field-card.required {
  border-left: 3px solid #ffc107;
}

.fi-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.fi-drop-zone:hover,
.fi-drop-zone.dragover {
  border-color: #198754;
  background: rgba(25, 135, 84, 0.05);
}

.fi-mapping-cols {
  display: flex;
  gap: 1.5rem;
}

.fi-mapping-cols>div {
  flex: 1;
}

.fi-preview-table {
  font-size: 0.75rem;
  max-height: 120px;
  overflow: auto;
}

.fi-error-table {
  font-size: 0.75rem;
  max-height: 250px;
  overflow: auto;
}

.imp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.imp-card {
  transition: border-color 0.15s;
}

.imp-card:hover {
  border-color: rgba(25, 135, 84, 0.5);
}

.um-list-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.1s;
}

.um-list-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.um-list-item:last-child {
  border-bottom: none;
}

.um-clickable {
  cursor: pointer;
  flex: 1;
  padding: 0.1rem 0;
}

.um-clickable:hover span:first-child {
  color: #60a5fa;
}

/* Users & Roles tab layout — fill available height */
.um-tab-content {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.um-tab-content>.tab-pane {
  height: 100%;
}

.um-tab-content>.tab-pane>.row {
  height: 100%;
}

.um-col-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.um-col-scroll>.dash-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.um-scroll-inner {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.ah-row {
  grid-template-columns: 1.1fr 1.1fr 0.6fr 0.6fr 0.9fr 0.7fr 0.7fr 0.8fr 0.4fr;
}

.ah-row-found {
  border-left: 3px solid rgba(34, 197, 94, 0.6);
}

.ah-row-missing {
  border-left: 3px solid rgba(239, 68, 68, 0.6);
}

.ah-row-italic .dash-cell {
  color: #6b7280;
  font-style: italic;
}

@media (max-width: 992px) {
  .ah-row {
    grid-template-columns: 1fr 1fr 0.6fr 0.6fr 0.8fr 80px;
  }

  .ah-cell-area,
  .ah-cell-zone,
  .ah-cell-dist {
    display: none;
  }
}
/* ===== Role editor: permission matrix =====
   On a wide panel the resource name sits far from its View/Change boxes, and
   the eye loses the row between them. Zebra striping plus a hover highlight
   gives it something to track; the column rules keep the two checkbox columns
   distinguishable from each other. */

.rp-table {
  border-collapse: collapse;
}

.rp-table th {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rp-row td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rp-row-alt {
  background: rgba(255, 255, 255, 0.035);
}

.rp-row:hover {
  background: rgba(13, 110, 253, 0.14);
}

/* The label cell stretches; a little padding keeps it off the panel edge and
   the whole row stays clickable-looking. */
.rp-row td:first-child {
  padding-left: 0.35rem;
}

/* Separate the two checkbox columns so "View" and "Change" cannot be misread
   for one another when the row is wide. */
.rp-table th:nth-child(2),
.rp-row td:nth-child(2) {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-table th:nth-child(3),
.rp-row td:nth-child(3) {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.rp-group td {
  padding-top: 0.6rem;
}

/* A disabled box here means "included by something you already ticked", not
   "unavailable" — so it should read as settled rather than greyed out. */
.rp-table input:disabled {
  opacity: 0.75;
}
