/* ========================================================
   DEMAS GERÄTE (DEVICES LIST PAGE) STYLES
   ======================================================== */


/* 1. Inline Zwischenablage (Clipboard) inside Toolbar */
.toolbar-center.clipboard-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px;
  border-left: 1px solid var(--c-white-a080);
  border-right: 1px solid var(--c-white-a080);
}

.clipboard-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.clipboard-count-badge {
  background: var(--c-navy-830);
  border: 1px solid var(--border-control);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.clipboard-count-badge.has-selection {
  background: var(--c-cyan-730-a220);
  border-color: var(--c-cyan-630);
  color: var(--text-hover);
}

.clipboard-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.clipboard-icon-btn {
  background: transparent;
  border: none;
  color: var(--c-slate-160);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.clipboard-icon-btn:hover:not(:disabled) {
  background: var(--c-white-a070);
  color: var(--text-white);
}

.clipboard-icon-btn:disabled {
  color: var(--c-slate-530);
  opacity: 0.4;
  cursor: default;
}

/* Clipboard 3-Dots Dropdown Menu */
.clipboard-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.clipboard-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--bg-button);
  border: 1px solid var(--c-navy-760b);
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 14px 34px var(--c-black-a750);
  z-index: 200;
  display: none;
  flex-direction: column;
}

.clipboard-dropdown-menu.open {
  display: flex;
}

.clipboard-menu-item {
  background: transparent;
  border: none;
  width: 100%;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--text-soft);
  transition: background 0.15s ease;
}

.clipboard-menu-item:hover:not(:disabled) {
  background: var(--bg-item-hover);
}

.clipboard-menu-item:disabled,
.clipboard-menu-item.disabled {
  opacity: 0.42;
  cursor: default;
}

.clipboard-menu-item .menu-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--c-slate-530);
  flex-shrink: 0;
}

.clipboard-menu-item:not(:disabled) .menu-icon.teal-svg {
  color: var(--c-cyan-510);
}

.clipboard-menu-item:not(:disabled) .menu-icon {
  color: var(--c-cyan-510);
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-white);
}

.menu-item-sub {
  font-size: 11.5px;
  color: var(--c-slate-350);
}

.clipboard-menu-divider {
  height: 1px;
  background: var(--c-white-a080);
  margin: 4px 0;
}

/* 2. Toolbar Card */

.toolbar-btn-teal {
  background: var(--c-cyan-730-a120);
  border: 1px solid var(--c-cyan-730);
  color: var(--c-cyan-510);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.toolbar-btn-teal:hover {
  background: var(--c-cyan-730-a240);
  color: var(--c-white);
}

.toolbar-btn.filter-clear-btn {
  background: var(--bg-button);
  border: 1px solid var(--border-subtle);
  color: var(--c-slate-530);
}

.toolbar-btn.filter-clear-btn.active {
  border-color: var(--c-slate-610);
  color: var(--text-strong);
}

.toolbar-btn.filter-clear-btn:hover {
  background: var(--c-navy-800);
  color: var(--text-white);
}

/* Column Visibility Dropdown */
.columns-dropdown-wrapper {
  position: relative;
}

.columns-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 230px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--c-navy-730);
  border-radius: 6px;
  padding: 8px 0;
  box-shadow: 0 12px 28px var(--c-black-a700);
  z-index: 120;
  display: none;
  flex-direction: column;
}

.columns-dropdown-menu.open {
  display: flex;
}

.col-toggle-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.col-toggle-item:hover {
  background: var(--bg-item-hover);
  color: var(--c-white);
}

.col-toggle-item input[type="checkbox"],
.table-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  background-color: var(--c-navy-800);
  border: 1px solid var(--text-dim);
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  position: relative;
  transition: all 0.15s ease;
  margin: 0;
}

.col-toggle-item input[type="checkbox"]:hover,
.table-checkbox:hover {
  border-color: var(--c-slate-350);
  background-color: var(--c-navy-750b);
}

.col-toggle-item input[type="checkbox"]:checked,
.table-checkbox:checked,
.table-checkbox:indeterminate {
  background-color: var(--c-teal-610);
  border-color: var(--c-cyan-510);
}

.col-toggle-item input[type="checkbox"]:checked::after,
.table-checkbox:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--c-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.table-checkbox:indeterminate::after {
  content: '';
  width: 8px;
  height: 2px;
  background-color: var(--c-white);
  border-radius: 1px;
}

/* 3. Devices Table Container & Scrollbar */
.devices-table-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--c-black-a400);
}

.devices-table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 255px);
  min-height: 380px;
  max-width: 100%;
}

.devices-table-scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.devices-table-scroll::-webkit-scrollbar-track {
  background: var(--bg-surface-dark);
}

.devices-table-scroll::-webkit-scrollbar-thumb {
  background: var(--c-slate-530);
  border-radius: 5px;
  border: 2px solid var(--c-navy-900);
}

.devices-table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--c-slate-350);
}

.devices-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.devices-table thead {
  position: sticky;
  top: 0;
  z-index: 15;
}

.devices-table .header-row th {
  background: var(--bg-raised);
  color: var(--text-soft);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--c-white-a060);
  white-space: nowrap;
  user-select: none;
}

.devices-table .header-row th.sortable {
  cursor: pointer;
}

.devices-table .header-row th.sortable:hover {
  background: var(--c-navy-830);
}

.th-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.th-label-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.drag-handle {
  color: var(--c-slate-530);
  font-size: 11px;
  letter-spacing: -1px;
  cursor: grab;
  padding: 2px 3px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.drag-handle:hover {
  color: var(--c-cyan-400);
  background: var(--c-cyan-400-a120);
}

.drag-handle:active {
  cursor: grabbing;
}

.devices-table .header-row th.dragging-col {
  opacity: 0.45;
  background: var(--c-navy-800) !important;
}

.devices-table .header-row th.drop-target-left {
  box-shadow: inset 3px 0 0 0 var(--c-cyan-510);
}

.devices-table .header-row th.drop-target-right {
  box-shadow: inset -3px 0 0 0 var(--c-cyan-510);
}

.sort-indicator {
  font-size: 10.5px;
  color: var(--c-slate-530);
}

.sort-indicator.active {
  color: var(--c-cyan-510);
}

.devices-table .filter-row th {
  background: var(--bg-input);
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--border-color);
}

.devices-table .col-filter,
.devices-table .col-select-filter {
  width: 100%;
  background: var(--bg-field);
  border: 1px solid var(--border-subtle);
  color: var(--text-strong);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.15s;
}

.devices-table .col-filter::placeholder {
  color: var(--c-slate-530);
}

.devices-table .col-filter:focus,
.devices-table .col-select-filter:focus {
  border-color: var(--c-cyan-630);
}

.devices-table .col-select-filter {
  cursor: pointer;
  appearance: auto;
}

/* Table Body Rows & Cells */
.devices-table tbody tr {
  border-bottom: 1px solid var(--divider-faint);
  transition: background 0.12s ease;
}

.devices-table tbody tr:hover {
  background: var(--c-navy-820e);
}

.devices-table tbody tr.selected-row {
  background: var(--c-cyan-730-a140);
}

.devices-table td {
  padding: 11px 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 12.5px;
}

/* Eye Action Button */
.device-eye-btn {
  background: transparent;
  border: none;
  color: var(--c-cyan-630);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.device-eye-btn:hover {
  background: var(--c-cyan-630-a160);
  color: var(--c-cyan-400);
  transform: scale(1.06);
}

/* Specific Cell Badges & Pills */
.cell-id {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

.cell-serial,
.cell-mac,
.cell-asset {
  color: var(--text-secondary);
}

.cell-name {
  color: var(--text-strong);
  font-weight: 400;
}

.dataset-pill {
  display: inline-block;
  background: var(--c-cyan-730-a120);
  border: 1px solid var(--c-cyan-730);
  color: var(--accent-strong);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  letter-spacing: 0.1px;
}

/* Status Pills (OK, Warnung, Fehler) */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
}

.status-pill.status-ok {
  background: var(--c-green-710);
  color: var(--c-white);
}

.status-pill.status-warnung {
  background: var(--c-orange-620);
  color: var(--c-white);
}

.status-pill.status-fehler {
  background: var(--c-red-530);
  color: var(--c-white);
}

/* Active Pill (Aktiv / Inaktiv) */
.active-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
}

.active-pill.is-active {
  background: var(--c-green-710);
  color: var(--c-white);
}

.active-pill.is-inactive {
  background: var(--c-navy-730);
  color: var(--c-white);
}

/* Counter Badges (Benutzerfelder, Plugin-Felder, Geräte-Plugin-Felder) */
.field-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-navy-830);
  border: 1px solid var(--c-navy-730);
  color: var(--c-white);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 400;
}

.field-count-badge i {
  font-size: 11px;
  color: var(--c-white);
}

/* Device Details Modal */
.device-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--c-navy-940-a720);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.device-modal-backdrop.open {
  display: flex;
}

.device-modal-card {
  background: var(--c-navy-870);
  border: 1px solid var(--c-navy-730);
  border-radius: 8px;
  width: 580px;
  max-width: 92vw;
  box-shadow: 0 20px 50px var(--c-black-a750);
  overflow: hidden;
}

.device-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--c-navy-850);
  border-bottom: 1px solid var(--c-white-a080);
}

.device-modal-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 9px;
}

.device-modal-title i {
  color: var(--c-cyan-510);
}


.device-modal-footer {
  padding: 12px 18px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========================================================
   GERÄTELISTEN (/custom-lists) & SAVE LIST MODAL STYLES
   ======================================================== */
.custom-lists-table {
  width: 100%;
  min-width: 920px;
}

.custom-list-link {
  color: var(--c-cyan-510);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s ease;
}

.custom-list-link:hover {
  color: var(--c-cyan-400);
  text-decoration: underline;
}

.custom-list-link i {
  font-size: 12px;
  color: var(--c-cyan-630);
}

.list-device-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-cyan-730);
  color: var(--c-white);
  font-size: 11.5px;
  font-weight: 400;
  padding: 2px 9px;
  border-radius: 5px;
  line-height: 1.4;
}

/* Active List Filter Banner on /devices */

/* Save to List Modal Form Elements */
.save-list-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.save-list-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-surface-dark);
  padding: 4px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.save-mode-tab {
  background: transparent;
  border: none;
  color: var(--c-slate-350);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-mode-tab.active {
  background: var(--c-cyan-730);
  color: var(--c-white);
}

.modal-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-text-input,
.modal-select-input {
  background: var(--bg-field);
  border: 1px solid var(--border-control);
  color: var(--text-white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.modal-text-input:focus,
.modal-select-input:focus {
  border-color: var(--c-cyan-510);
}

.demo-security-hint {
  background: var(--c-cyan-630-a100);
  border: 1px solid var(--c-cyan-630-a350);
  color: var(--c-slate-350);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.demo-security-hint i {
  color: var(--c-cyan-510);
  margin-top: 2px;
}

/* Toast Notification */
.demas-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-input);
  border: 1px solid var(--accent-strong);
  color: var(--text-white);
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--c-black-a650);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  z-index: 3000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.22s ease;
}

.demas-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.demas-toast a {
  color: var(--c-cyan-400);
  font-weight: 600;
  text-decoration: underline;
}


/* ========================================================
   DEVICE TYPES (GERÄTETYPEN) TABLE STYLES
   ======================================================== */
.badge-pill-green {
  background: var(--c-green-640);
  color: var(--c-white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.count-badge-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--c-navy-830);
  border: 1px solid var(--c-navy-730);
  color: var(--c-slate-350);
  min-width: 24px;
}

.count-badge-box.has-count {
  background: var(--c-cyan-730);
  border-color: var(--c-cyan-730);
  color: var(--c-white);
  font-weight: 600;
}

.count-badge-box.cyan-active {
  background: var(--c-cyan-510);
  border-color: var(--c-cyan-510);
  color: var(--c-blue-890);
  font-weight: 700;
}

.device-type-name-link {
  color: var(--c-cyan-510);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.device-type-name-link:hover {
  color: var(--c-cyan-310);
  text-decoration: underline;
}

.cell-id-truncate {
  font-family: monospace;
  font-size: 11px;
  color: var(--c-slate-350);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}


/* ==========================================================================
   New Device Type Modal (Neuen Gerätetyp erstellen)
   ========================================================================== */
.new-type-modal-card {
  width: min(1040px, 94vw) !important;
  max-width: 1040px !important;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--c-navy-900);
  border: 1px solid var(--c-navy-780);
  border-radius: 8px;
  box-shadow: 0 24px 60px var(--c-black-a850);
  overflow: hidden;
}

.new-type-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px 14px;
  background: var(--c-navy-900);
  gap: 16px;
}

.new-type-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.new-type-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.new-type-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-white);
  letter-spacing: -0.2px;
  margin: 0;
  line-height: 1.2;
}

.new-type-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-save-device-type {
  background: var(--c-teal-610);
  color: var(--c-white);
  border: 1px solid var(--c-teal-610);
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-save-device-type:disabled,
.btn-save-device-type[disabled] {
  background: var(--c-teal-610) !important;
  color: var(--c-white);
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--c-teal-610) !important;
}

/* Tabs Bar */
.new-type-tabs-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--c-navy-900);
}

.new-type-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--c-cyan-510);
  color: var(--c-cyan-510);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.new-type-tab .material-icons {
  font-size: 16px;
  color: var(--c-cyan-510);
}

/* Modal Body */
.new-type-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-field);
}

.new-type-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

.new-type-section-header .material-icons {
  font-size: 18px;
  color: var(--c-cyan-510);
}

/* Form Card */
.new-type-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.new-type-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 720px) {
  .new-type-row-2col {
    grid-template-columns: 1fr;
  }
}

.new-type-row-full {
  display: flex;
  flex-direction: column;
}

.new-type-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
}



/* ==========================================================================
   Device Type Detail Modal (Gerätetyp-Details)
   ========================================================================== */
.device-type-detail-card {
  width: min(1200px, 95vw) !important;
  max-width: 1200px !important;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--c-navy-900);
  border: 1px solid var(--c-navy-780);
  border-radius: 8px;
  box-shadow: 0 24px 60px var(--c-black-a850);
  overflow: hidden;
}

.device-type-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px 12px;
  background: var(--c-navy-900);
  gap: 16px;
}

.dt-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dt-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dt-detail-title {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-white);
  letter-spacing: -0.2px;
  margin: 0;
}

.device-type-meta-sub {
  font-size: 12px;
  color: var(--c-slate-380);
}

.dt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-locked-status {
  background: var(--c-navy-850);
  border: 1px solid var(--border-subtle);
  color: var(--c-slate-160);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  user-select: none;
}

.device-type-info-banner {
  background: var(--c-cyan-690-a160);
  border: 1px solid var(--c-cyan-510-a300);
  border-radius: 6px;
  color: var(--c-blue-140);
  font-size: 12.5px;
  padding: 10px 16px;
  margin: 0 24px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-type-info-banner i {
  color: var(--c-cyan-400);
  font-size: 15px;
  flex-shrink: 0;
}

.dt-detail-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.dt-empty-state-card {
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  color: var(--c-slate-530);
  box-sizing: border-box;
}

.dt-grid-2col {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
  align-items: start;
}


.dt-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.dt-field-group:last-child {
  margin-bottom: 0;
}

.dt-field-label {
  font-size: 12px;
  color: var(--c-slate-350);
  font-weight: 500;
}

.dt-id-text {
  font-family: monospace;
  font-size: 12.5px;
  color: var(--text-main);
  padding: 4px 0 6px;
  word-break: break-all;
}

.readonly-input {
  background: var(--bg-field);
  border: 1px solid var(--c-navy-800) !important;
  color: var(--c-slate-160) !important;
  cursor: default;
}

.readonly-input::placeholder {
  color: var(--c-slate-580);
  font-style: italic;
}

.dt-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.dt-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dt-slider {
  position: absolute;
  cursor: default;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--c-navy-800);
  transition: .2s;
  border-radius: 20px;
}

.dt-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--c-slate-160);
  transition: .2s;
  border-radius: 50%;
}

.dt-switch input:checked + .dt-slider {
  background-color: var(--c-teal-610);
}

.dt-switch input:checked + .dt-slider:before {
  transform: translateX(16px);
  background-color: var(--c-white);
}

.dt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}

.dt-meta-label {
  font-size: 11.5px;
  color: var(--c-slate-350);
  margin-bottom: 4px;
}

.dt-meta-val {
  font-size: 12.5px;
  color: var(--text-strong);
  font-weight: 500;
}

.clickable-type-row {
  cursor: pointer;
}

.clickable-type-row:hover td {
  background: var(--c-navy-840b);
}

/* ========================================================
   MODERN WIDE DEVICE DETAIL MODAL (TABS & ACTIONS)
   ======================================================== */
.dev-detail-modal-card {
  width: min(1240px, 95vw) !important;
  max-width: 1240px !important;
  height: min(840px, 92vh) !important;
  min-height: 650px !important;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--c-navy-890b);
  border-radius: 10px;
  border: 1px solid var(--c-white-a080);
  box-shadow: 0 20px 45px var(--c-black-a500);
  overflow: hidden;
}

.dev-detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--c-white-a080);
  flex-shrink: 0;
  background: var(--c-navy-890b);
  gap: 16px;
}

.dev-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dev-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dev-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dev-main-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: 0.3px;
  font-family: inherit;
}

.dev-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.dev-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-slate-350);
  flex-wrap: wrap;
}

.dev-sub-sep {
  color: var(--c-white-a200);
}

.dev-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.dev-header-action-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.btn-dev-action {
  background: var(--c-cyan-510-a120);
  color: var(--c-cyan-510);
  border: 1px solid var(--c-cyan-510-a350);
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-dev-action:hover {
  background: var(--c-cyan-510-a220);
  border-color: var(--c-cyan-510);
  color: var(--c-white);
}

.dev-action-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--c-slate-530);
  letter-spacing: 0.2px;
}

.btn-dev-reset-action {
  background: transparent;
  color: var(--c-orange-500);
  border: 1px solid var(--c-orange-500-a450);
  border-radius: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-dev-reset-action:hover {
  background: var(--c-orange-500-a150);
  border-color: var(--c-orange-500);
  color: var(--c-amber-440);
}

.dev-detail-subtabs,
.location-detail-subtabs.dev-detail-subtabs {
  background: var(--c-navy-890b);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px 0;
  margin-top: 4px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden !important;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none !important;
}

.dev-detail-subtabs::-webkit-scrollbar,
.location-detail-subtabs.dev-detail-subtabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.dev-detail-modal-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
}

.dev-detail-modal-body .dev-tab-pane {
  display: none;
  width: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 0;
}

.dev-detail-modal-body .dev-tab-pane.active {
  display: flex;
}

.dev-detail-modal-body .new-location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px !important;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  align-items: stretch;
  box-sizing: border-box;
  overflow-x: hidden;
}

.dev-detail-modal-body .new-location-col,
.dev-detail-modal-body .dev-left-col,
.dev-detail-modal-body .dev-right-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dev-detail-modal-body .new-loc-card {
  min-width: 0;
  max-width: 100%;
}

.dev-card-full-height {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.dev-card-full-height .new-loc-row-2col {
  margin-bottom: 14px;
}

.dev-row-status-active {
  align-items: center;
  margin-top: 6px;
}

.dt-switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.dt-switch-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-white);
}

.dev-status-label {
  margin-bottom: 4px;
}

.dev-warranty-field {
  margin-top: 14px;
}

.dev-links-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.dev-links-card .dev-links-empty-box {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.dev-empty-pane-box {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 380px;
  box-sizing: border-box;
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 40px 20px;
}

.dev-empty-pane-box i {
  font-size: 32px;
  opacity: 0.5;
  margin-bottom: 12px;
}

.dev-empty-pane-box p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted, var(--c-slate-350));
}

.dev-type-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 4px 0;
}

.dev-summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dev-summary-col-right {
  text-align: right;
}

.dev-summary-label {
  font-size: 11.5px;
  color: var(--c-slate-350);
  font-weight: 500;
}

.dev-summary-val {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
}

.dev-plugin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-blue-610);
  color: var(--c-white);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.dev-warranty-val {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 600;
  padding-top: 2px;
}

.dev-links-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 16px;
  color: var(--c-slate-530);
  font-size: 13px;
  border: 1px dashed var(--c-white-a080);
  border-radius: 6px;
  background: var(--c-black-a120);
}

.dev-links-empty-box i {
  font-size: 28px;
  opacity: 0.6;
}

.clickable-device-row {
  cursor: pointer;
}

.clickable-device-row:hover td {
  background: var(--c-navy-840b);
}

/* ========================================================
   DEV METADATEN (2-ZEILIG OHNE OVERFLOW)
   ======================================================== */
.dev-metadaten-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.dev-meta-row {
  display: grid;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.dev-meta-row-2col {
  grid-template-columns: 1.6fr 1fr;
  align-items: start;
}

.dev-meta-row-3col {
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: start;
}

.meta-id-item {
  min-width: 0;
}

.meta-id-item .meta-val-mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-secondary);
  display: block;
  max-width: 100%;
}

/* ========================================================
   RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ======================================================== */
@media (max-width: 900px) {
  .dt-grid-2col {
    grid-template-columns: 1fr;
  }

  .toolbar-center.clipboard-inline {
    border-left: none;
    border-right: none;
    padding: 6px 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .dev-detail-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    height: auto !important;
    max-height: 92vh;
    margin: auto;
  }

  .dev-detail-modal-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dev-header-left {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .dev-title-block {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .dev-header-left .btn-detail-back,
  #btnCloseDeviceModal {
    order: 2;
    margin-left: auto;
    align-self: flex-start;
    flex-shrink: 0;
  }

  .dev-header-right {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .dev-header-action-group {
    align-items: stretch;
    width: 100%;
  }

  .btn-dev-action,
  .btn-dev-reset-action {
    width: 100%;
    justify-content: center;
  }

  .dev-action-hash {
    text-align: center;
    font-size: 9px;
    word-break: break-all;
  }

  .dev-detail-subtabs,
  .location-detail-subtabs.dev-detail-subtabs {
    padding: 8px 12px 0 !important;
    margin-bottom: 0 !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .dev-detail-modal-body {
    padding: 14px 12px !important;
  }

  .dev-type-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dev-summary-col-right {
    text-align: left;
  }

  .dev-meta-row-2col,
  .dev-meta-row-3col {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .meta-id-item {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .dt-meta-grid {
    grid-template-columns: 1fr;
  }

  .device-modal-header,
  .device-modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }
}


/* ========================================================
   LIGHT MODE OVERRIDES (devices.css)
   ======================================================== */

html[data-theme="light"] .clipboard-count-badge {
  background: var(--c-slate-20);
  border: 1px solid var(--c-slate-160);
}

html[data-theme="light"] .clipboard-count-badge.has-selection {
  background: var(--c-cyan-730-a120);
  border-color: var(--c-cyan-730);
}

html[data-theme="light"] .clipboard-icon-btn {
  color: var(--c-navy-650);
}

html[data-theme="light"] .clipboard-icon-btn:hover:not(:disabled) {
  background: var(--c-slate-40);
}

html[data-theme="light"] .clipboard-dropdown-menu,
html[data-theme="light"] .columns-dropdown-menu {
  border: 1px solid var(--c-slate-160);
  box-shadow: 0 10px 25px var(--c-blue-890-a140);
}

html[data-theme="light"] .clipboard-menu-item,
html[data-theme="light"] .col-toggle-item {
  color: var(--c-navy-730);
}

html[data-theme="light"] .clipboard-menu-item:hover:not(:disabled),
html[data-theme="light"] .col-toggle-item:hover {
  color: var(--c-blue-890);
}

html[data-theme="light"] .toolbar-btn.filter-clear-btn {
  background: var(--c-white);
  border: 1px solid var(--c-slate-160);
  color: var(--c-slate-530);
}

html[data-theme="light"] .toolbar-btn.filter-clear-btn.active,
html[data-theme="light"] .toolbar-btn.filter-clear-btn:hover {
  background: var(--c-slate-40);
  border-color: var(--c-slate-350);
  color: var(--c-blue-890);
}

html[data-theme="light"] .col-toggle-item input[type="checkbox"],
html[data-theme="light"] .table-checkbox {
  background-color: var(--c-white);
  border: 1px solid var(--c-slate-350);
}

html[data-theme="light"] .devices-table-card {
  box-shadow: 0 1px 4px var(--c-blue-890-a060);
}

html[data-theme="light"] .devices-table-scroll::-webkit-scrollbar-track {
  background: var(--c-slate-40);
}

html[data-theme="light"] .devices-table .header-row th {
  background: var(--c-slate-20);
  color: var(--c-navy-730);
  border-bottom: 1px solid var(--c-slate-90);
}

html[data-theme="light"] .devices-table .header-row th.sortable:hover {
  background: var(--c-slate-40);
}

html[data-theme="light"] .devices-table .filter-row th {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-slate-90);
}

html[data-theme="light"] .devices-table .col-filter,
html[data-theme="light"] .devices-table .col-select-filter {
  border: 1px solid var(--c-slate-160);
  color: var(--c-blue-890);
}

html[data-theme="light"] .devices-table tbody tr:hover,
html[data-theme="light"] .clickable-device-row:hover td,
html[data-theme="light"] .clickable-type-row:hover td {
  background: var(--c-blue-30) !important;
}

html[data-theme="light"] .cell-name {
  font-weight: 500;
}

html[data-theme="light"] .dataset-pill {
  background: var(--c-cyan-730-a080);
  border-color: var(--c-cyan-730);
}

html[data-theme="light"] .field-count-badge,
html[data-theme="light"] .count-badge-box:not(.has-count):not(.cyan-active) {
  background: var(--c-slate-20);
  border: 1px solid var(--c-slate-160);
  color: var(--c-navy-730);
}

html[data-theme="light"] .field-count-badge i {
  color: var(--c-navy-650);
}

/* Modals (Device Detail, Save List, Device Types) in Light Mode */
html[data-theme="light"] .device-modal-card,
html[data-theme="light"] .dev-detail-modal-card,
html[data-theme="light"] .new-type-modal-card,
html[data-theme="light"] .device-type-detail-card {
  background: var(--c-white);
  border: 1px solid var(--c-slate-160);
  box-shadow: 0 20px 50px var(--c-blue-890-a180);
}

html[data-theme="light"] .device-modal-header,
html[data-theme="light"] .dev-detail-modal-header,
html[data-theme="light"] .new-type-modal-header,
html[data-theme="light"] .device-type-detail-header {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-slate-90);
}

html[data-theme="light"] .dev-detail-subtabs,
html[data-theme="light"] .location-detail-subtabs.dev-detail-subtabs,
html[data-theme="light"] .new-type-tabs-bar {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-slate-90);
}

html[data-theme="light"] .readonly-input {
  border: 1px solid var(--c-slate-160) !important;
  color: var(--c-blue-890) !important;
}

html[data-theme="light"] .btn-locked-status {
  background: var(--c-slate-40) !important;
  color: var(--c-navy-650) !important;
}

html[data-theme="light"] .dev-links-empty-box {
  background: var(--c-white);
  border: 1px dashed var(--c-slate-160);
}

html[data-theme="light"] .save-mode-tab:not(.active) {
  color: var(--c-slate-530);
}

html[data-theme="light"] .modal-text-input,
html[data-theme="light"] .modal-select-input {
  border: 1px solid var(--c-slate-160);
}

html[data-theme="light"] .demas-toast {
  box-shadow: 0 10px 25px var(--c-blue-890-a150);
}

/* Beschriftung neben Schaltern (z. B. "Aktiv") – vorher als Inline-Style im HTML */
.toggle-text-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Vorher Inline-Farben im HTML */
.new-dev-date-box {
  width: 100%;
  height: 38px;
  background: var(--bg-field);
  border: 1px solid var(--c-navy-760b);
  border-radius: 5px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}
.new-dev-date-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
  outline: none;
}
html[data-theme="light"] .new-dev-date-box {
  border-color: var(--c-slate-160);
}
.meta-section-title {
  color: var(--c-slate-350);
}
.hint-muted {
  color: var(--c-slate-380);
}

/* ==========================================================================
   HELL-MODUS: Lesbarkeit in Fenstern (Popups)
   Graue Beschriftungen, Hinweise und Metadaten-Überschriften dunkler,
   Schalter-Beschriftung und Info-Banner gut lesbar.
   ========================================================================== */
html[data-theme="light"] .meta-label,
html[data-theme="light"] .dt-meta-label,
html[data-theme="light"] .dt-field-label,
html[data-theme="light"] .new-loc-label,
html[data-theme="light"] .new-loc-field-hint,
html[data-theme="light"] .meta-section-title,
html[data-theme="light"] .dev-summary-label,
html[data-theme="light"] .dev-subtitle-row span,
html[data-theme="light"] #dtSubCreatedBy,
html[data-theme="light"] .comm-detail-item-label,
html[data-theme="light"] .comm-checklist-title {
  color: var(--c-navy-650);
}

html[data-theme="light"] .device-type-info-banner {
  background: var(--c-blue-60);
  border-color: var(--c-blue-140);
  color: var(--c-blue-760);
}

html[data-theme="light"] .device-type-info-banner i {
  color: var(--c-blue-610);
}
