:root{font-family:Arial,sans-serif;color:#222;background:#f3f5f7}*{box-sizing:border-box}body{margin:0}header{height:58px;background:#036;color:#fff;display:flex;align-items:center;padding:0 24px;gap:36px}.brand{font-size:22px;font-weight:bold}nav{display:flex;gap:20px}header a{color:#fff;text-decoration:none}main{width:100%;max-width:none;margin:24px 0;padding:0 24px}.toolbar{display:flex;justify-content:space-between;align-items:center}.button,button{background:#0878bd;color:#fff;border:0;border-radius:4px;padding:10px 15px;text-decoration:none;cursor:pointer}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.card{display:flex;gap:14px;background:#fff;border:1px solid #d8dde2;border-radius:6px;padding:14px;text-decoration:none;color:#222}.card img,.placeholder{width:58px;height:58px;object-fit:contain;border-radius:5px}.card img{flex:0 0 58px;padding:2px;background:transparent}.placeholder{display:grid;place-items:center;background:#dbeaf3;font-size:26px}.card small{display:block;color:#667;margin-top:8px}table{width:100%;border-collapse:collapse;background:#fff}th,td{text-align:left;border-bottom:1px solid #ddd;padding:10px}th{background:#e8edf1}a{color:#056ca8}.filters{display:flex;gap:10px;margin:12px 0 18px;flex-wrap:wrap}.filters a{background:#fff;border:1px solid #ccd4da;padding:7px 10px;border-radius:4px;text-decoration:none}form{background:#fff;padding:20px;border:1px solid #d8dde2;border-radius:6px}label{display:block;margin-bottom:14px;font-weight:bold}input,select,textarea{display:block;width:100%;padding:9px;margin-top:5px;border:1px solid #bbb;border-radius:4px;font:inherit}textarea{min-height:100px}.detail{display:grid;grid-template-columns:280px 1fr;gap:24px;background:#fff;padding:20px}.asset-image{max-width:100%;max-height:260px;object-fit:contain}dl{display:grid;grid-template-columns:220px 1fr;margin:0}dt,dd{padding:9px;border-bottom:1px solid #eee;margin:0}dt{font-weight:bold}@media(max-width:700px){.detail{grid-template-columns:1fr}dl{grid-template-columns:1fr}header{padding:0 10px;gap:12px}nav{gap:9px}}
.panel{background:#fff;border:1px solid #ccd4dc;border-radius:4px;padding:18px;margin-top:18px;overflow:auto}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.card{background:#fff;border:1px solid #ccd4dc;padding:16px;display:flex;flex-direction:column}.card strong{font-size:28px}.config-list{display:grid;grid-template-columns:minmax(130px,220px) 1fr;gap:8px 16px}.sync-status{display:inline-block;padding:3px 8px;border-radius:12px;background:#e5e7eb}.status-success,.status-synced,.status-created,.status-updated{background:#d9f2df}.status-conflict,.status-partial{background:#fff0c2}.status-error,.status-missing{background:#ffd9d9}code{word-break:break-all}
.log-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.log-header h2{margin:0}.sync-log{height:340px;overflow:auto;background:#111827;color:#e5e7eb;border-radius:5px;padding:12px;font-family:Consolas,"Courier New",monospace;font-size:13px;line-height:1.55;white-space:pre-wrap}.log-line{padding:1px 0}.log-debug{color:#9ca3af}.log-info{color:#dbeafe}.log-success{color:#86efac}.log-warning{color:#fde68a}.log-error{color:#fca5a5}button:disabled{opacity:.65;cursor:wait}
.toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.inline-form{display:inline;margin:0;padding:0;background:transparent;border:0}.button-danger{background:#b42318}.button-danger:hover{background:#912018}.empty-state{text-align:center;color:#667;padding:24px}
.table-scroll{overflow:auto}.table-hint{color:#667;font-size:13px}.multiline{white-space:pre-line;min-width:140px}#asset-table th[draggable=true]{cursor:grab;user-select:none}#asset-table th.dragging{opacity:.45}#asset-table{min-width:900px}

@media(max-width:700px){main{padding:0 10px}}
.button-secondary{background:#546675}.column-filter-row th{padding:6px;background:#f5f7f9}.column-filter-row input{margin:0;min-width:110px;padding:6px;font-size:13px}.sortable-column{cursor:pointer;user-select:none;padding-right:24px;position:relative}.sortable-column.sort-asc::after{content:"▲";position:absolute;right:7px;font-size:10px}.sortable-column.sort-desc::after{content:"▼";position:absolute;right:7px;font-size:10px}tr[hidden]{display:none}.history-old,.history-new{white-space:pre-wrap}

/* Tabellen: fixierte Kopfzeilen und kompakte Aktionsschaltflächen */
.sticky-table{max-height:calc(100vh - 170px);overflow:auto;border:1px solid #d8dde2;background:#fff}
.sticky-table thead tr:first-child th{position:sticky;top:0;z-index:4}
.sticky-table thead .column-filter-row th{position:sticky;top:41px;z-index:3}
.actions-column,.row-actions{white-space:nowrap;text-align:center;min-width:145px}
.row-actions{white-space:nowrap;text-align:center}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:4px;text-decoration:none;color:#fff;cursor:pointer;font-size:16px;line-height:1}
.button-issue{background:#198754}.button-issue:hover{background:#146c43}
.button-return{background:#d97706}.button-return:hover{background:#b45309}
.button-duplicate{background:#6f42c1}.button-duplicate:hover{background:#59359a}
.button-save{background:#0878bd}.notice{padding:10px 14px;background:#fff3cd;border:1px solid #ffe69c;border-radius:4px}
.checkbox{width:auto;display:inline-block}.form-actions{margin-top:16px}

/* Temporäre Hinweise und Fehlermeldungen */
.toast-container {
  position: fixed;
  z-index: 5000;
  display: flex;
  width: min(430px, calc(100vw - 2rem));
  flex-direction: column;
  gap: .65rem;
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: .55rem;
  background: #fff;
  box-shadow: 0 .45rem 1.4rem rgba(0,0,0,.22);
  opacity: 1;
  transform: translateY(0);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: auto;
}
.toast-error { border-left: .42rem solid #b42318; }
.toast-warning { border-left: .42rem solid #b7791f; }
.toast-success { border-left: .42rem solid #137333; }
.toast-symbol { font-weight: 700; }
.toast-error .toast-symbol { color: #b42318; }
.toast-warning .toast-symbol { color: #b7791f; }
.toast-success .toast-symbol { color: #137333; }
.toast-close {
  border: 0;
  background: transparent;
  padding: 0 .15rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.toast-hide { opacity: 0; transform: translateY(-.5rem); }

/* v0.3.0: Branding, Navigation und breite/responsive Tabellen */
html,body{max-width:100%;overflow-x:hidden}main{min-width:0}.main-header{min-height:58px;height:auto;flex-wrap:wrap}.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;white-space:nowrap}.brand img{width:38px;height:38px;object-fit:contain;border-radius:4px;background:#fff}.main-nav{flex:1;flex-wrap:wrap}.user-menu{position:relative;margin-left:auto}.user-menu summary{cursor:pointer;list-style:none;color:#fff;white-space:nowrap}.user-menu summary::-webkit-details-marker{display:none}.user-menu-panel{position:absolute;right:0;top:calc(100% + 10px);z-index:100;background:#fff;color:#222;border:1px solid #ccd4da;border-radius:5px;box-shadow:0 8px 24px rgba(0,0,0,.18);min-width:210px;padding:8px}.user-menu-panel a,.user-menu-panel span{display:block;padding:9px 10px}.user-menu-panel a{text-decoration:none}.disabled-link{pointer-events:none;opacity:.55}.muted{color:#667;font-size:13px}.settings-form{max-width:900px}.settings-section{margin-bottom:26px}.settings-section h2{margin-top:0}.logo-preview{display:flex;align-items:center;gap:18px;margin:12px 0}.logo-preview img{max-width:220px;max-height:90px;object-fit:contain;border:1px solid #ddd;padding:6px;background:#fff}.checkbox-label{display:flex;align-items:center;gap:8px;margin:0}.table-scroll,.sticky-table{width:100%;max-width:100%;overflow-x:auto;overflow-y:auto}.data-table{width:max-content;min-width:100%;table-layout:auto}.data-table th,.data-table td{max-width:420px;overflow-wrap:anywhere}.data-table th{white-space:nowrap}.sticky-table{overscroll-behavior:contain}.sticky-table::-webkit-scrollbar{height:14px;width:14px}
@media(max-width:900px){header{gap:14px;padding:10px 14px}.main-nav{order:3;width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}main{padding:0 12px}.toolbar{align-items:flex-start;gap:12px;flex-wrap:wrap}.toolbar-actions{width:100%}.detail{grid-template-columns:1fr}}

/* v0.3.1: Firmenname und Benutzerverwaltung */
.brand-company{font-size:15px;font-weight:normal;opacity:.9}.settings-subsection{padding:16px;border:1px solid #d8dde2;border-radius:6px;background:#f8fafb}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.checkbox-row{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:14px}.auth-card{max-width:520px;margin:40px auto;background:#fff;padding:24px;border:1px solid #d8dde2;border-radius:8px}.auth-card form{padding:0;border:0}.profile-panel{max-width:850px}.compact-form{padding:0;border:0}.user-inline-form{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr)) auto auto auto;gap:6px;align-items:center;padding:0;border:0;background:transparent;min-width:760px}.user-inline-form input{margin:0;padding:6px}.user-inline-form .checkbox-label{margin:0;font-size:12px}.user-inline-form button{padding:7px 10px}@media(max-width:700px){.form-grid{grid-template-columns:1fr}.brand-company{display:none}}

/* Benutzer-Dropdown: Links müssen sich von der weißen Navigation unterscheiden. */
.user-menu-panel a { color:#1f2933 !important; }
.user-menu-panel a:visited { color:#1f2933 !important; }
.user-menu-panel a:hover { color:#0b4f86 !important; background:#eef4f8; border-radius:4px; }
.user-menu-panel .muted { color:#667085 !important; }
.group-checkboxes{display:flex;flex-wrap:wrap;gap:.5rem 1rem}.user-permission-form fieldset{margin:.75rem 0;padding:.75rem}dialog{border:0;border-radius:10px;padding:1.25rem;box-shadow:0 20px 60px rgba(0,0,0,.25);min-width:min(420px,90vw)}dialog::backdrop{background:rgba(0,0,0,.35)}dialog form{display:grid;gap:1rem}


/* Baustruktur */
.tree-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem;align-items:end;margin-bottom:1.25rem}.tree-scroll{overflow:auto;padding:1rem 0}.asset-tree,.asset-tree ul{list-style:none;margin:0;padding:0;display:flex;justify-content:center;gap:1.25rem;position:relative}.asset-tree ul{padding-top:1.6rem}.tree-item{display:flex;flex-direction:column;align-items:center;position:relative}.tree-item>ul:before{content:"";position:absolute;top:0;left:50%;height:1.6rem;border-left:1px solid #aeb8c2}.tree-card{width:230px;min-height:88px;background:#fff;border:1px solid #d7dde3;border-radius:10px;box-shadow:0 2px 8px rgba(31,41,51,.08);display:flex;overflow:hidden}.tree-card img,.tree-placeholder{width:72px;min-width:72px;height:88px;object-fit:cover;background:#eef2f5;display:flex;align-items:center;justify-content:center;font-size:1.5rem}.tree-card-body{padding:.65rem;min-width:0}.tree-name{display:block;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tree-meta,.tree-category{font-size:.78rem;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tree-category{margin-top:.25rem;color:#0b4f86}@media(max-width:800px){.asset-tree,.asset-tree ul{justify-content:flex-start}.tree-card{width:205px}}

/* Baustruktur v0.3.4.3: kompakte Kategorie-Icons und Mehrfachfilter */
.tree-category-filter{margin:0;padding:.55rem .7rem;border:1px solid #d7dde3;border-radius:7px;min-width:0}.tree-category-filter legend{padding:0 .25rem;font-weight:600}.tree-category-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:.25rem .7rem;max-height:130px;overflow:auto}.tree-category-filter small{display:block;margin-top:.35rem;color:#667085}.tree-hide-option{align-self:center}.tree-card{width:215px;min-height:78px;align-items:center}.tree-category-icon{width:48px;min-width:48px;height:78px;background:#eef4f8;color:#0b4f86;display:flex;align-items:center;justify-content:center}.tree-category-icon svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.tree-category-icon svg circle{fill:currentColor;stroke:none}.tree-card-body{padding:.55rem .65rem}.tree-card img,.tree-placeholder{display:none}@media(max-width:800px){.tree-card{width:195px}.tree-category-icon{width:42px;min-width:42px}}

/* Baustruktur v0.3.4.6: durchgehende Verbindungslinien mit Abzweigern */
.tree-scroll {
  --tree-line-color: #8ea4b8;
  --tree-line-width: 2px;
  --tree-branch-height: 30px;
  padding: 1.25rem 1rem 2rem;
}

/* Die alten, nur senkrechten Verbindungslinien deaktivieren. */
.asset-tree .tree-item > ul::before {
  display: none;
}

.asset-tree,
.asset-tree ul {
  gap: 0;
  overflow: visible;
}

.asset-tree > .tree-item {
  margin-inline: 1rem;
}

.asset-tree .tree-item {
  position: relative;
  padding-inline: .7rem;
}

/* Abstand zwischen Elternkarte und der darunterliegenden Abzweigung. */
.asset-tree .tree-item > ul {
  position: relative;
  padding-top: calc(var(--tree-branch-height) * 2);
}

/* Senkrechte Leitung von der Elternkarte bis zur horizontalen Sammelschiene. */
.asset-tree .tree-item > ul::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: var(--tree-branch-height);
  border-left: var(--tree-line-width) solid var(--tree-line-color);
  transform: translateX(-50%);
}

/* Obere Hälfte der Verbindung jedes Kindes: horizontale Sammelschiene. */
.asset-tree .tree-item > ul > .tree-item::before,
.asset-tree .tree-item > ul > .tree-item::after {
  content: "";
  position: absolute;
  top: calc(var(--tree-branch-height) * -1);
  width: 50%;
  height: var(--tree-branch-height);
  border-top: var(--tree-line-width) solid var(--tree-line-color);
  pointer-events: none;
}

.asset-tree .tree-item > ul > .tree-item::before {
  right: 50%;
}

.asset-tree .tree-item > ul > .tree-item::after {
  left: 50%;
  border-left: var(--tree-line-width) solid var(--tree-line-color);
  border-top-left-radius: 9px;
}

/* Erstes Kind: keine Linie über die linke Außenkante hinaus. */
.asset-tree .tree-item > ul > .tree-item:first-child::before {
  border-top: 0;
}

.asset-tree .tree-item > ul > .tree-item:first-child::after {
  border-top-left-radius: 9px;
}

/* Letztes Kind: rechte Außenkante abschließen und abrunden. */
.asset-tree .tree-item > ul > .tree-item:last-child::after {
  border-top: 0;
  border-left: 0;
}

.asset-tree .tree-item > ul > .tree-item:last-child::before {
  border-right: var(--tree-line-width) solid var(--tree-line-color);
  border-top-right-radius: 9px;
}

/* Ein einziges Kind benötigt keine horizontale Sammelschiene. */
.asset-tree .tree-item > ul > .tree-item:only-child::before,
.asset-tree .tree-item > ul > .tree-item:only-child::after {
  border: 0;
}

.asset-tree .tree-item > ul > .tree-item:only-child::after {
  left: 50%;
  width: 0;
  border-left: var(--tree-line-width) solid var(--tree-line-color);
  border-radius: 0;
}

/* Die senkrechte Leitung endet sauber mittig an der Gerätekarte. */
.asset-tree .tree-item > ul > .tree-item > .tree-card::before {
  content: "";
  position: absolute;
  top: calc(var(--tree-branch-height) * -1);
  left: 50%;
  width: 0;
  height: var(--tree-branch-height);
  border-left: var(--tree-line-width) solid var(--tree-line-color);
  transform: translateX(-50%);
  pointer-events: none;
}

.asset-tree .tree-card {
  position: relative;
  z-index: 1;
}

/* Bei mehreren unabhängigen Wurzeln werden keine künstlichen Linien gezogen. */
.asset-tree > .tree-item::before,
.asset-tree > .tree-item::after,
.asset-tree > .tree-item > .tree-card::before {
  display: none;
}

@media (max-width: 800px) {
  .tree-scroll {
    --tree-branch-height: 24px;
    padding-inline: .5rem;
  }
  .asset-tree .tree-item {
    padding-inline: .45rem;
  }
}

/* Diagramme v0.3.5 */
:root {
  --chart-color-0:#2563eb; --chart-color-1:#16a34a; --chart-color-2:#f59e0b;
  --chart-color-3:#dc2626; --chart-color-4:#7c3aed; --chart-color-5:#0891b2;
  --chart-color-6:#ea580c; --chart-color-7:#4f46e5; --chart-color-8:#65a30d;
  --chart-color-9:#db2777; --chart-color-10:#0f766e; --chart-color-11:#64748b;
}
.chart-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,430px),1fr));gap:1rem;margin:1rem 0 1.5rem}.chart-card{background:#fff;border:1px solid #dfe4ea;border-radius:12px;padding:1rem;min-width:0;box-shadow:0 1px 3px rgba(15,23,42,.06)}.chart-card-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:1rem}.chart-card-head h3{margin:0 0 .25rem}.chart-card-head p{margin:0;color:#64748b;font-size:.9rem}.chart-total{white-space:nowrap;background:#eef2ff;color:#1f2937;border-radius:999px;padding:.3rem .55rem;font-size:.8rem;font-weight:700}.donut-layout{display:flex;align-items:center;gap:1.4rem;min-height:230px}.donut-chart{width:190px;aspect-ratio:1;border-radius:50%;position:relative;flex:0 0 auto}.donut-chart:after{content:"";position:absolute;inset:27%;background:#fff;border-radius:50%;box-shadow:0 0 0 1px #eef2f7}.donut-chart span{position:absolute;inset:0;display:grid;place-items:center;z-index:1;font-size:1.5rem;font-weight:800}.donut-chart.pie-chart:after{display:none}.donut-chart.pie-chart span{color:#fff;text-shadow:0 1px 3px #0008}.chart-legend{display:grid;gap:.45rem;min-width:0;flex:1}.chart-legend>div{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:.45rem;font-size:.88rem}.chart-legend i,.stack-legend i{width:10px;height:10px;border-radius:3px;background:var(--legend-color);display:inline-block}.chart-legend span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-chart{display:grid;gap:.65rem}.bar-row{display:grid;grid-template-columns:minmax(90px,28%) minmax(120px,1fr) 35px;gap:.6rem;align-items:center}.bar-label{font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track{height:25px;border-radius:6px;background:#eef2f7;overflow:hidden;display:flex}.bar-segment{height:100%;min-width:2px;background:var(--segment-color);display:flex;align-items:center;justify-content:flex-end;color:#fff;font-size:.75rem;font-weight:700}.bar-segment span{padding:0 .4rem;text-shadow:0 1px 1px #0005}.bar-value{text-align:right;font-size:.85rem}.stack-legend{display:flex;flex-wrap:wrap;gap:.75rem;margin:-.2rem 0 .9rem;font-size:.8rem}.stack-legend span{display:flex;align-items:center;gap:.3rem}.chart-empty{display:grid;place-items:center;min-height:180px;color:#64748b}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:1.5rem}.section-heading h2{margin:0}.form-card{background:#fff;border:1px solid #dfe4ea;border-radius:12px;padding:1rem;max-width:980px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.chart-form label{display:grid;gap:.35rem}.checkbox-row{display:flex;flex-wrap:wrap;gap:1.25rem;margin:1rem 0}.checkbox-row label{display:flex;align-items:center;gap:.4rem}.muted-disabled{opacity:.45}.block{display:block}.dashboard-charts .chart-card{min-height:280px}@media(max-width:700px){.donut-layout{flex-direction:column}.form-grid{grid-template-columns:1fr}.bar-row{grid-template-columns:90px minmax(90px,1fr) 30px}}

/* Mehrfachauswahl und Massenänderung v0.3.6.2 */
.selection-column{width:42px;min-width:42px;text-align:center}.selection-column input{width:18px;height:18px;cursor:pointer}.toolbar-actions button:disabled{opacity:.5;cursor:not-allowed}.bulk-edit-panel{max-width:900px}.compact-list{columns:2;column-gap:2rem}.compact-list li{break-inside:avoid;margin:.25rem 0}.hidden-control{display:none!important}.user-delete-form{margin-top:.75rem;padding-top:.75rem;border-top:1px solid #e5e7eb}.user-delete-form .button-danger{width:auto}@media(max-width:700px){.compact-list{columns:1}}
.header-actions{display:flex;align-items:center;gap:.5rem}.language-menu{position:relative}.language-menu summary{cursor:pointer;list-style:none;padding:.45rem .65rem;border-radius:.45rem}.menu-button{display:block;width:100%;border:0;background:transparent;text-align:left;padding:.55rem .8rem;cursor:pointer}.menu-button:hover,.menu-button.active{background:rgba(0,0,0,.06)}.translation-import{margin-top:1rem}.translation-import input[type=file]{margin-right:1rem}.table-wrap textarea{min-width:240px;width:100%;resize:vertical}.toolbar-actions{display:flex;gap:.5rem;flex-wrap:wrap}

/* v0.3.8.0 central field catalog */
.field-capabilities{display:flex;flex-wrap:wrap;gap:.5rem 1rem}.field-capabilities .checkbox-label{min-width:150px}.data-table input[type=checkbox]{width:auto;margin:.2rem auto}.mesh-mapping-table input,.mesh-mapping-table select{min-width:130px}.settings-form small{display:block;margin-top:.3rem;color:#667085;font-weight:normal}
.mesh-mapping-table{min-width:1750px}.mesh-mapping-table input,.mesh-mapping-table select{min-width:130px}.mesh-mapping-table .mapping-path{min-width:360px;font-family:monospace}.mesh-mapping-table .mapping-priority{min-width:65px;width:75px}.mesh-mapping-table .mapping-separator{min-width:65px;width:75px}

/* Dropdown forms inherit the compact menu styling instead of the global form card. */
.user-menu-panel form{margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;width:100%}
.user-menu-panel .menu-button{display:block;width:100%;margin:0;padding:9px 10px;border:0;border-radius:4px;background:transparent;color:#222;text-align:left;cursor:pointer}
.user-menu-panel .menu-button:hover{background:#eef4f8;color:#0b4f86}
.user-menu-panel .menu-button.active{background:#e4edf5;color:#0b4f86;font-weight:600}


/* v0.3.8.6: benutzerspezifische Toast-Position */
.toast-position-top-left{top:1rem;left:1rem;align-items:flex-start}
.toast-position-top-center{top:1rem;left:50%;transform:translateX(-50%);align-items:center}
.toast-position-top-right{top:1rem;right:1rem;align-items:flex-end}
.toast-position-bottom-left{bottom:1rem;left:1rem;align-items:flex-start;flex-direction:column-reverse}
.toast-position-bottom-center{bottom:1rem;left:50%;transform:translateX(-50%);align-items:center;flex-direction:column-reverse}
.toast-position-bottom-right{bottom:1rem;right:1rem;align-items:flex-end;flex-direction:column-reverse}
@media(max-width:520px){.toast-container{left:1rem!important;right:1rem!important;width:auto;transform:none!important}.toast-position-top-left,.toast-position-top-center,.toast-position-top-right{top:1rem}.toast-position-bottom-left,.toast-position-bottom-center,.toast-position-bottom-right{bottom:1rem}}

/* Diagramm-Statusfilter */
.checkbox-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px 16px;margin:10px 0}
.checkbox-option{display:flex;align-items:center;gap:8px;margin:0;padding:8px 10px;border:1px solid #d8dde2;border-radius:6px;background:#f8fafc}
.checkbox-option input{width:auto;margin:0}
.inline-form{display:inline-block;margin:0;padding:0;border:0;background:transparent}

/* Geräteinventar mit aufklappbarer Baumansicht */
.inventory-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
.inventory-header h2{margin-bottom:4px}.inventory-meta{display:flex;gap:18px;flex-wrap:wrap;padding:12px 0 16px;border-bottom:1px solid #d9e1e8}.inventory-meta code{word-break:break-all}
.inventory-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:18px 0 0;border-bottom:1px solid #cbd6df}.inventory-tab{border:0;background:transparent;color:#111;padding:10px 14px;cursor:pointer;border-bottom:3px solid transparent;font-weight:600}.inventory-tab:hover{color:#000;background:rgba(0,0,0,.035)}.inventory-tab.active{color:#000;border-bottom-color:#0b4f86;background:rgba(0,0,0,.04)}
.inventory-tab-content{display:none;padding-top:16px}.inventory-tab-content.active{display:block}.inventory-tree{position:relative;padding-left:4px}.inventory-node{margin:4px 0}.inventory-node>summary{display:flex;align-items:center;gap:8px;cursor:pointer;padding:7px 9px;border-radius:5px;font-weight:600}.inventory-node>summary:hover{background:rgba(0,0,0,.05)}.inventory-count{font-size:.8em;font-weight:400;opacity:.65;border:1px solid currentColor;border-radius:10px;padding:0 6px}.inventory-children{position:relative;margin-left:15px;padding-left:18px;border-left:2px solid #c9d5df}.inventory-children:before{content:"";position:absolute;left:-2px;top:0;width:14px;border-top:2px solid #c9d5df}.inventory-property{display:grid;grid-template-columns:minmax(150px,280px) minmax(180px,1fr);gap:16px;position:relative;padding:7px 9px;margin:2px 0;border-radius:4px}.inventory-property:before{content:"";position:absolute;left:-20px;top:50%;width:18px;border-top:2px solid #c9d5df}.inventory-property:hover{background:rgba(0,0,0,.035)}.inventory-property>span{word-break:break-word}.inventory-property>strong{font-weight:500;word-break:break-word}.json-viewer{max-height:650px;overflow:auto;background:#111827;color:#e5e7eb;padding:16px;border-radius:6px;white-space:pre-wrap;word-break:break-word}.empty-state{padding:24px;border:1px dashed #b9c6d0;border-radius:6px;text-align:center}.table-filter-row{max-width:480px;margin-bottom:12px}.table-filter-row label{display:block}.table-filter-row input{width:100%}.table-scroll{overflow:auto}
@media(max-width:700px){.inventory-property{grid-template-columns:1fr;gap:3px}.inventory-children{margin-left:6px;padding-left:12px}.inventory-property:before{left:-14px;width:12px}}


/* v0.3.9.1: Inventar-Icons und globaler CSS-Editor */
.inventory-section-icon{display:inline-grid;place-items:center;width:1.45rem;min-width:1.45rem;height:1.45rem;font-size:1.05rem;line-height:1;filter:saturate(1.15)}
.custom-css-editor{display:block;width:100%;min-height:360px;resize:vertical;font-family:Consolas,"Liberation Mono",Menlo,monospace;font-size:.9rem;line-height:1.5;tab-size:2;white-space:pre}


/* v0.3.9.7: record count in the upper-right toolbar */
.record-count{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:7px 11px;
  border:1px solid #c9d3dc;
  border-radius:4px;
  background:#fff;
  color:#44515c;
  font-size:13px;
  font-weight:600;
  white-space:nowrap;
}
.toolbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

/* v0.3.9.7: use exactly one vertical scrollbar on pages with sticky tables */
body.single-scroll-list{
  height:100vh;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
body.single-scroll-list .main-header{
  flex:0 0 auto;
}
body.single-scroll-list main{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  margin-top:14px;
  margin-bottom:0;
}
body.single-scroll-list .sticky-table{
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  overflow:auto;
  margin-bottom:0;
}
body.single-scroll-list .sticky-table + .muted{
  flex:0 0 auto;
  margin:6px 0 8px;
}
@media(max-width:900px){
  body.single-scroll-list{
    height:auto;
    min-height:100vh;
    overflow:auto;
    display:block;
  }
  body.single-scroll-list main{
    display:block;
    overflow:visible;
  }
  body.single-scroll-list .sticky-table{
    max-height:calc(100vh - 220px);
  }
}


/* v0.3.9.8: direct asset edit action */
.button-edit{background:#0b6fa4}
.button-edit:hover{background:#07577f}

/* v0.3.9.8: category list - valid table geometry and compact attributes */
.categories-table td,
.categories-table th{vertical-align:middle}
.categories-table .category-actions{white-space:nowrap;min-width:285px}
.categories-table .action-buttons{display:flex;align-items:center;gap:6px;justify-content:flex-start}
.categories-table .action-buttons .button{padding:7px 10px}
.category-attributes{min-width:320px;max-width:620px}
.attribute-chip{
  display:inline-block;
  margin:2px 4px 2px 0;
  padding:3px 7px;
  border:1px solid #c9d3dc;
  border-radius:999px;
  background:#f5f7f9;
  color:#44515c;
  font-size:12px;
  white-space:nowrap;
}
.attribute-chip-list{
  border-color:#8ab9d4;
  background:#eaf5fb;
  color:#07577f;
}

/* Uploaded favicon preview should remain favicon-sized. */
.favicon-preview img{
  width:48px;
  height:48px;
  object-fit:contain;
  image-rendering:auto;
}

/* Keep action cell borders aligned; flex belongs inside the cell, not on td. */
.row-actions{
  display:table-cell;
  vertical-align:middle;
  text-align:center;
}
.row-actions > .inline-form,
.row-actions > .icon-button{
  margin:2px;
}


/* v0.3.9.9: accessible horizontal scrolling */
.table-scrollbar-top{
  width:100%;
  height:16px;
  overflow-x:auto;
  overflow-y:hidden;
  border:1px solid #d8dde2;
  border-bottom:0;
  background:#f5f7f9;
}
.table-scrollbar-top > div{height:1px}
.table-scrollbar-top[hidden]{display:none}
#asset-table-scroll{border-top:0}

/* Column visibility dialog and header context menu */
.column-settings-dialog{width:min(520px,92vw)}
.column-settings-dialog form{padding:0;border:0}
.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.dialog-heading h2{margin:0}
.column-settings-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  max-height:55vh;
  overflow:auto;
  margin:14px 0;
}
.column-context-menu{
  position:fixed;
  z-index:7000;
  min-width:190px;
  padding:5px;
  border:1px solid #c9d3dc;
  border-radius:6px;
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.column-context-menu button{
  display:block;
  width:100%;
  padding:8px 10px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:#222;
  text-align:left;
}
.column-context-menu button:hover{background:#eef4f8;color:#0b4f86}

/* Fixed field widths should clip long values instead of expanding the table. */
#asset-table th[style*="width"],
#asset-table td[style*="width"]{
  overflow:hidden;
  text-overflow:ellipsis;
}
#asset-table td[style*="width"]{
  white-space:nowrap;
}
@media(max-width:700px){
  .column-settings-list{grid-template-columns:1fr}
}


/* v0.3.10.0: thicker and easier-to-grab asset table scrollbars */
#asset-table-scroll-top{
  height:24px;
  scrollbar-width:auto;
}
#asset-table-scroll{
  scrollbar-width:auto;
}
#asset-table-scroll-top::-webkit-scrollbar,
#asset-table-scroll::-webkit-scrollbar{
  width:20px;
  height:20px;
}
#asset-table-scroll-top::-webkit-scrollbar-track,
#asset-table-scroll::-webkit-scrollbar-track{
  background:#e7ebef;
  border:1px solid #c5ced6;
}
#asset-table-scroll-top::-webkit-scrollbar-thumb,
#asset-table-scroll::-webkit-scrollbar-thumb{
  background:#8797a5;
  border:3px solid #e7ebef;
  border-radius:10px;
}
#asset-table-scroll-top::-webkit-scrollbar-thumb:hover,
#asset-table-scroll::-webkit-scrollbar-thumb:hover{
  background:#607383;
}

/* About dialog */
.header-help-button{
  display:inline-grid;
  place-items:center;
  width:30px;
  height:30px;
  padding:0;
  border:1px solid rgba(255,255,255,.45);
  border-radius:50%;
  background:transparent;
  color:#fff;
  font-weight:700;
}
.header-help-button:hover{background:rgba(255,255,255,.16)}
.about-dialog{width:min(620px,92vw)}
.about-dialog form{padding:0;border:0}
.about-logo{text-align:center;margin:8px 0 16px}
.about-logo img{max-width:220px;max-height:90px;object-fit:contain}
.about-manufacturer-logo{text-align:center;margin:8px 0 18px}
.about-manufacturer-logo img{display:block;width:auto;height:auto;max-width:150px;max-height:150px;object-fit:contain;margin:0 auto}
.about-details{grid-template-columns:150px minmax(0,1fr)}
.about-details dd{overflow-wrap:anywhere}


/* v0.3.12.0: duplicate search in current filtered asset list */
.duplicate-search-dialog{width:min(570px,92vw)}
.duplicate-search-dialog form{padding:0;border:0}
#asset-table tbody tr.duplicate-hidden{display:none!important}
#asset-table tbody tr.duplicate-match td{
  background:#fff8d8;
}
#asset-table tbody tr.duplicate-match:hover td{
  background:#fff1ad;
}


/* v0.3.13.0: hidden technical forms do not create whitespace */
.hidden-utility-form{
  display:none!important;
  width:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}

.merge-order-table tbody tr{cursor:grab}
.merge-order-table tbody tr.dragging{opacity:.45}
.merge-drag-handle{width:70px;text-align:center;font-size:20px;user-select:none;cursor:grab}
.merge-order-table td{vertical-align:top}


/* v0.3.13.1: category controls and dashboard cards must keep text inside */
.filters{
  align-items:flex-start;
}
.filters a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.2;
  text-align:center;
}

.cards{
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
}
.cards .card{
  min-width:0;
  overflow:hidden;
}
.cards .card > *{
  min-width:0;
  max-width:100%;
}
.cards .card h2,
.cards .card h3,
.cards .card strong,
.cards .card span,
.cards .card a{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}
.cards .card h2,
.cards .card h3{
  line-height:1.12;
  margin-top:.35rem;
  margin-bottom:.35rem;
}


/* v0.3.14.0: compact global sidebar */
.app-shell{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100vh - 58px);transition:grid-template-columns .16s ease}
.app-shell.sidebar-collapsed{grid-template-columns:58px minmax(0,1fr)}
.side-nav{position:relative;background:#f5f7f9;border-right:1px solid #d7dee5;padding:10px 8px;overflow:visible;z-index:30}
.side-nav>a,.side-nav-settings>.settings-trigger,.side-nav-toggle{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:8px 10px;border:0;border-radius:5px;background:transparent;color:inherit;text-decoration:none;white-space:nowrap;box-sizing:border-box}
.side-nav>a:hover,.side-nav-settings>.settings-trigger:hover,.side-nav-toggle:hover{background:#e5edf3}
.nav-icon{display:inline-flex;width:24px;min-width:24px;justify-content:center;font-size:18px}
.nav-label{overflow:hidden;text-overflow:ellipsis}
.nav-caret{margin-left:auto}
.sidebar-collapsed .nav-label,.sidebar-collapsed .nav-caret{display:none}
.sidebar-collapsed .side-nav>a,.sidebar-collapsed .side-nav-settings>.settings-trigger,.sidebar-collapsed .side-nav-toggle{justify-content:center;padding-left:6px;padding-right:6px}
.app-content{min-width:0;padding:14px}
.settings-hover-menu{display:none;position:absolute;left:calc(100% - 5px);top:0;min-width:235px;background:#fff;border:1px solid #cbd5df;border-radius:5px;box-shadow:0 8px 24px rgba(0,0,0,.16);padding:6px;z-index:100}
.side-nav-settings{position:relative}
.side-nav-settings:hover .settings-hover-menu,.side-nav-settings:focus-within .settings-hover-menu{display:block}
.settings-hover-menu a{display:block;padding:8px 10px;border-radius:4px;color:inherit;text-decoration:none;white-space:nowrap}
.settings-hover-menu a:hover{background:#eaf2f7}

/* Settings page with independent left submenu */
.settings-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:18px;align-items:start}
.settings-subnav{position:sticky;top:12px;border:1px solid #d7dee5;border-radius:6px;background:#fff;padding:10px}
.settings-subnav h2{margin:4px 8px 10px}
.settings-subnav a{display:block;padding:8px 10px;border-radius:4px;text-decoration:none;color:inherit}
.settings-subnav a:hover,.settings-subnav a.active{background:#e5edf3}
.settings-main{min-width:0}
.system-info-grid{display:grid;grid-template-columns:minmax(160px,220px) minmax(0,1fr);gap:8px 18px;margin:0}
.system-info-grid dt{font-weight:700}
.system-info-grid dd{margin:0;overflow-wrap:anywhere}
@media(max-width:900px){.app-shell,.app-shell.sidebar-collapsed{grid-template-columns:58px minmax(0,1fr)}.nav-label,.nav-caret{display:none}.settings-layout{grid-template-columns:1fr}.settings-subnav{position:static}}


/* v0.3.14.1: no duplicate settings navigation inside content */
.settings-main{display:contents}
.settings-action-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:16px;
}

/* v0.3.14.4: stable first paint and right aligned header menus */
.main-header{display:flex;align-items:center;flex-wrap:nowrap}
.header-actions{margin-left:auto;justify-content:flex-end;flex:0 0 auto}
html.sidebar-collapsed-preset .app-shell{grid-template-columns:58px minmax(0,1fr)}
html.sidebar-collapsed-preset .nav-label,html.sidebar-collapsed-preset .nav-caret{display:none}
html.sidebar-collapsed-preset .side-nav>a,html.sidebar-collapsed-preset .side-nav-settings>.settings-trigger,html.sidebar-collapsed-preset .side-nav-toggle{justify-content:center;padding-left:6px;padding-right:6px}
.app-shell:not(.sidebar-ready){transition:none}
.asset-list-initializing #asset-table-scroll,.asset-list-initializing #asset-table-scroll-top{visibility:hidden}
.asset-list-page #asset-table-scroll{contain:layout paint}
@media(max-width:700px){.main-header{flex-wrap:wrap}.header-actions{margin-left:auto}}


/* v0.3.14.5: coordinated asset-page initialization */
.asset-page-loader{
  display:none;
  min-height:calc(100vh - 110px);
  align-items:center;
  justify-content:center;
  padding:24px;
  box-sizing:border-box;
}
html.asset-page-booting .asset-page-loader{display:flex}
html.asset-page-booting .asset-list-page{
  position:absolute;
  left:-100000px;
  top:0;
  width:calc(100% - 28px);
  visibility:hidden;
  pointer-events:none;
}
.asset-page-loader-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:min(360px,90vw);
  padding:28px 34px;
  border:1px solid #d7dee5;
  border-radius:8px;
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  text-align:center;
}
.asset-page-spinner{
  width:30px;
  height:30px;
  border:3px solid #d7dee5;
  border-top-color:currentColor;
  border-radius:50%;
  animation:asset-page-spin .75s linear infinite;
}
@keyframes asset-page-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
  .asset-page-spinner{animation-duration:1.6s}
}


/* v0.3.15.0: asset-table performance refactoring */
#asset-table.asset-table-fixed{
  table-layout:fixed;
  max-width:none;
}
#asset-table.asset-table-fixed th,
#asset-table.asset-table-fixed td{
  box-sizing:border-box;
  overflow:hidden;
  text-overflow:ellipsis;
}
#asset-table.asset-table-fixed td{
  white-space:nowrap;
}
#asset-table.asset-table-fixed td.multiline{
  white-space:nowrap;
}



/* v0.3.15.2: complete scroll-height chain for the sidebar layout */
body.asset-list-scroll-page{
  height:100vh;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

body.asset-list-scroll-page > .main-header{
  flex:0 0 auto;
}

body.asset-list-scroll-page > .app-shell{
  flex:1 1 auto;
  height:auto;
  min-height:0;
  overflow:hidden;
}

body.asset-list-scroll-page .side-nav{
  min-height:0;
}

body.asset-list-scroll-page .app-content{
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

body.asset-list-scroll-page #asset-page-loader{
  flex:1 1 auto;
  min-height:0;
}

body.asset-list-scroll-page #asset-list-page{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

body.asset-list-scroll-page #asset-list-page > .toolbar,
body.asset-list-scroll-page #asset-list-page > .filters,
body.asset-list-scroll-page #asset-list-page > .table-hint,
body.asset-list-scroll-page #asset-list-page > .hidden-utility-form,
body.asset-list-scroll-page #asset-list-page > #asset-table-scroll-top,
body.asset-list-scroll-page #asset-list-page > .muted{
  flex:0 0 auto;
}

body.asset-list-scroll-page #asset-table-scroll{
  flex:1 1 auto;
  width:100%;
  max-width:100%;
  min-height:0;
  max-height:none;
  overflow-x:auto;
  overflow-y:auto;
  overscroll-behavior:contain;
}

/* The older containment rule prevents reliable scroll sizing in this layout. */
body.asset-list-scroll-page .asset-list-page #asset-table-scroll{
  contain:none;
}

@media(max-width:900px){
  body.asset-list-scroll-page{
    height:auto;
    min-height:100vh;
    overflow:auto;
    display:block;
  }

  body.asset-list-scroll-page > .app-shell{
    min-height:calc(100vh - 58px);
    overflow:visible;
  }

  body.asset-list-scroll-page .app-content,
  body.asset-list-scroll-page #asset-list-page{
    overflow:visible;
    display:block;
  }

  body.asset-list-scroll-page #asset-table-scroll{
    max-height:calc(100vh - 240px);
    overflow:auto;
  }
}


/* v0.4.0.1 backup management */
.backup-page{max-width:1400px}.backup-page-header{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:22px}.backup-page-header h1{margin-bottom:6px}.backup-create-form{padding:0;border:0;background:transparent}.backup-primary-action{min-height:42px;padding:10px 18px}.backup-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}.backup-summary-card{display:flex;align-items:center;gap:14px;min-height:92px;padding:18px;background:#fff;border:1px solid #ccd4dc;border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.03)}.backup-summary-icon{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:8px;background:#eef4f8;font-size:22px}.backup-summary-card div{display:flex;flex-direction:column;gap:7px;min-width:0}.backup-summary-label{font-size:12px;color:#667085;text-transform:uppercase;letter-spacing:.04em}.backup-summary-card strong{font-size:16px;overflow-wrap:anywhere}.backup-summary-card code{font-size:14px}.backup-panel{padding:22px;margin-top:16px;overflow:visible}.backup-panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.backup-panel-heading h2{margin:0 0 6px}.backup-panel-heading p{margin:0}.backup-status-badge,.backup-count{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:5px 10px;border-radius:999px;background:#d9f2df;color:#185c2c;font-size:12px;font-weight:700}.backup-content-note{display:flex;align-items:flex-start;gap:10px;padding:14px 16px;border:1px solid #d9e4ec;border-radius:7px;background:#f7fafc}.backup-content-note p{margin:0;color:#53606d;line-height:1.5}.backup-upload-form{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:12px;align-items:end;padding:16px;border:1px solid #d8e0e7;border-radius:7px;background:#f8fafb}.backup-upload-form input[type=file]{margin:0;width:100%;background:#fff}.backup-table-wrap{border:1px solid #d8e0e7;border-radius:7px}.backup-table{margin:0}.backup-table th{background:#f5f7f9}.backup-actions{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.backup-actions form{display:inline;padding:0;border:0;background:transparent}.backup-dialog{max-width:560px;border:0;border-radius:8px;padding:0;box-shadow:0 16px 50px rgba(0,0,0,.3)}.backup-dialog::backdrop{background:rgba(20,30,40,.45)}.backup-dialog form{padding:24px;border:0}.backup-empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:38px 18px;border:1px dashed #c8d1da;border-radius:8px;background:#fafbfc}.backup-empty-state>span{font-size:34px;margin-bottom:10px}.backup-empty-state p{margin:6px 0 0}@media(max-width:900px){.backup-summary-grid{grid-template-columns:1fr}.backup-page-header{flex-direction:column}.backup-upload-form{grid-template-columns:1fr}.backup-create-form,.backup-create-form button{width:100%}}




/* v0.4.0.3: one vertical scroll area on management pages */
.management-table-scroll{
  width:100%;
  max-width:100%;
  max-height:none;
  min-height:0;
  overflow-x:auto;
  overflow-y:visible;
  overscroll-behavior-x:contain;
  border:1px solid #d8dde2;
  border-radius:6px;
  background:#fff;
}

.management-table-scroll .data-table{
  margin:0;
}

/* Sticky headers only need to follow the browser scroll on these pages. */
.management-table-scroll thead tr:first-child th{
  position:sticky;
  top:58px;
  z-index:4;
}

.management-table-scroll thead .column-filter-row th{
  position:sticky;
  top:99px;
  z-index:3;
}

/* Asset tree category selector */
.tree-category-filter{
  min-width:0;
  padding:0;
  border:1px solid #cfd7df;
  border-radius:8px;
  background:#fff;
  overflow:hidden;
}

.tree-category-filter legend{
  margin-left:12px;
  padding:0 8px;
  font-weight:700;
  color:#253544;
}

.tree-category-options{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:8px;
  max-height:190px;
  padding:14px;
  overflow:auto;
  scrollbar-gutter:stable;
  background:#f8fafc;
  border-top:1px solid #e7ebef;
  border-bottom:1px solid #e7ebef;
}

.tree-category-option{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  padding:9px 10px;
  border:1px solid #dfe5ea;
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.tree-category-option:hover{
  border-color:#9eb4c7;
  background:#f5f9fc;
}

.tree-category-option:has(input:focus-visible){
  outline:2px solid currentColor;
  outline-offset:2px;
}

.tree-category-option:has(input:checked){
  border-color:#55758e;
  background:#eef5fa;
  box-shadow:inset 3px 0 0 #55758e;
}

.tree-category-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.tree-category-check{
  flex:0 0 18px;
  width:18px;
  height:18px;
  border:1px solid #9aa9b5;
  border-radius:4px;
  background:#fff;
  display:grid;
  place-items:center;
}

.tree-category-option input:checked + .tree-category-check{
  border-color:#55758e;
  background:#55758e;
}

.tree-category-option input:checked + .tree-category-check::after{
  content:"";
  width:8px;
  height:4px;
  border-left:2px solid #fff;
  border-bottom:2px solid #fff;
  transform:rotate(-45deg) translateY(-1px);
}

.tree-category-name{
  min-width:0;
  font-weight:600;
  line-height:1.25;
  overflow-wrap:anywhere;
}

.tree-category-filter > small{
  display:block;
  padding:8px 14px 10px;
  color:#697884;
  background:#fff;
}

@media(max-width:900px){
  .management-table-scroll thead tr:first-child th,
  .management-table-scroll thead .column-filter-row th{
    position:static;
  }

  .tree-category-options{
    grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  }
}


/* v0.4.0.4: professional full-width asset-tree filters */
.tree-filters{
  display:block;
  padding:18px;
}

.tree-filter-controls{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) minmax(280px,1.15fr) auto;
  gap:16px;
  align-items:end;
  margin-bottom:18px;
}

.tree-filter-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  font-weight:600;
}

.tree-filter-field select,
.tree-filter-field input{
  width:100%;
}

.tree-toggle-option{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:42px;
  padding:8px 12px;
  border:1px solid #d7dee5;
  border-radius:7px;
  background:#f8fafc;
  cursor:pointer;
  font-weight:600;
}

.tree-toggle-option:hover{
  border-color:#9eb4c7;
  background:#f3f7fa;
}

.tree-toggle-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.tree-toggle-track{
  position:relative;
  flex:0 0 38px;
  width:38px;
  height:22px;
  border-radius:999px;
  background:#a9b5bf;
  transition:background .15s ease;
}

.tree-toggle-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.28);
  transition:transform .15s ease;
}

.tree-toggle-option input:checked + .tree-toggle-track{
  background:#55758e;
}

.tree-toggle-option input:checked + .tree-toggle-track .tree-toggle-thumb{
  transform:translateX(16px);
}

.tree-toggle-option:has(input:focus-visible){
  outline:2px solid currentColor;
  outline-offset:2px;
}

.tree-toggle-text{
  line-height:1.25;
}

.tree-filter-actions{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:42px;
}

.tree-category-filter{
  width:100%;
  box-sizing:border-box;
}

.tree-category-options{
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  max-height:220px;
}

@media(max-width:1150px){
  .tree-filter-controls{
    grid-template-columns:repeat(2,minmax(220px,1fr));
  }

  .tree-filter-actions{
    justify-content:flex-start;
  }
}

@media(max-width:700px){
  .tree-filter-controls{
    grid-template-columns:1fr;
  }

  .tree-filter-actions,
  .tree-filter-actions .button{
    width:100%;
  }

  .tree-filter-actions .button{
    text-align:center;
  }

  .tree-category-options{
    grid-template-columns:1fr;
  }
}


/* v0.4.0.5: one common filter row for every data table */
.column-filter-row{
  display:table-row !important;
  visibility:visible !important;
}

.column-filter-row[hidden]{
  display:table-row !important;
}

.column-filter-row th{
  display:table-cell !important;
}

.column-filter-row input[type="search"]{
  display:block;
  width:100%;
  min-width:90px;
  box-sizing:border-box;
}

/* Management pages use browser scrolling; avoid clipped sticky rows. */
.management-table-scroll thead tr:first-child th,
.management-table-scroll thead .column-filter-row th{
  position:static;
  top:auto;
}

/* Asset table keeps its own sticky behavior inside its dedicated scroller. */
#asset-table-scroll #asset-table thead tr:first-child th{
  position:sticky;
  top:0;
  z-index:4;
}

#asset-table-scroll #asset-table thead .column-filter-row th{
  position:sticky;
  top:41px;
  z-index:3;
}


/* v0.4.0.8: clearly visible active table filters */
.column-filter-row input[type="search"]{
  transition:
    background-color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.column-filter-row th.filter-cell-active{
  background:#fff2c7;
}

.column-filter-row input[type="search"].filter-input-active{
  background:#fff7d8;
  border-color:#cf9b16;
  box-shadow:
    0 0 0 2px rgba(207,155,22,.18),
    inset 3px 0 0 #cf9b16;
  font-weight:600;
}

.column-filter-row input[type="search"].filter-input-active:focus{
  background:#fff9e5;
  border-color:#a87500;
  box-shadow:
    0 0 0 3px rgba(207,155,22,.24),
    inset 3px 0 0 #a87500;
}

.table-filter-status{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  box-sizing:border-box;
  margin:0 0 8px;
  padding:8px 10px;
  border:1px solid #d8dde2;
  border-radius:6px;
  background:#f8fafc;
  color:#344554;
  font-size:13px;
}

.table-filter-status[hidden]{
  display:none !important;
}

.table-filter-status.is-active{
  border-color:#d4a735;
  background:#fff8df;
  color:#604900;
}

.table-filter-status-icon{
  display:inline-grid;
  place-items:center;
  flex:0 0 24px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#d4a735;
  color:#fff;
  font-size:15px;
  font-weight:700;
}

.table-filter-status-label{
  white-space:nowrap;
}

.table-filter-status-details{
  min-width:0;
  color:#6a5a25;
}

.table-filter-clear{
  margin-left:auto;
  padding:5px 9px;
  font-size:12px;
  white-space:nowrap;
}

.asset-list-page > .table-filter-status{
  flex:0 0 auto;
}

@media(max-width:700px){
  .table-filter-status{
    flex-wrap:wrap;
  }

  .table-filter-status-details{
    flex:1 1 calc(100% - 44px);
  }

  .table-filter-clear{
    width:100%;
    margin-left:0;
  }
}


/* v0.4.0.9: configurable system colors */
html,body{background:var(--am-page-bg);color:var(--am-text)}
body,main,.app-content{color:var(--am-text)}
.main-header{background:var(--am-header)}
.side-nav{background:var(--am-navigation);border-color:var(--am-border)}
.panel,.auth-card,.tree-card,.backup-card,.settings-section,dialog,
.data-table,.management-table-scroll,.sticky-table,.table-scroll{
  background-color:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
}
button,.button{background-color:var(--am-primary)}
button:hover,.button:hover{background-color:var(--am-primary-hover)}
.button-secondary{background:#546675}
.button-danger{background:var(--am-danger)}
.button-save{background:var(--am-primary)}
.button-issue{background:var(--am-success)}
.button-return{background:var(--am-warning)}
input,select,textarea{
  background:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
}
th{background:#e7ecf0;color:var(--am-text)}
td,th{border-color:var(--am-border)}
a{color:var(--am-primary)}
.filters a{border-color:var(--am-border);background:var(--am-surface)}
.filters a:hover{border-color:var(--am-primary)}
.notice{color:#594600}
.muted,.table-hint,small{color:color-mix(in srgb,var(--am-text) 67%,transparent)}

/* Header theme switch */
.header-theme-form{margin:0;padding:0;border:0;background:transparent}
.header-theme-toggle{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:48px;
  height:27px;
  padding:3px 6px;
  border:1px solid rgba(255,255,255,.45);
  border-radius:999px;
  background:rgba(255,255,255,.16);
  color:#fff;
}
.header-theme-toggle:hover{background:rgba(255,255,255,.28)}
.header-theme-toggle::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:19px;
  height:19px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.3);
  transition:transform .18s ease;
}
html[data-theme="dark"] .header-theme-toggle::after{transform:translateX(21px)}
.theme-icon-light,.theme-icon-dark{font-size:13px;line-height:1;z-index:1}
.theme-icon-light{color:#d99000}.theme-icon-dark{color:#dce8ff}

/* Profile theme cards */
.theme-mode-choice{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:10px 0 16px}
.theme-choice-card{position:relative;display:grid;gap:8px;padding:10px;border:2px solid var(--am-border);border-radius:8px;cursor:pointer}
.theme-choice-card:has(input:checked){border-color:var(--am-primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--am-primary) 20%,transparent)}
.theme-choice-card input{position:absolute;opacity:0}
.theme-choice-preview{display:grid;grid-template-columns:28% 1fr;gap:5px;height:70px;padding:6px;border-radius:5px;border:1px solid #adb5bd}
.theme-choice-preview span:first-child{border-radius:3px}
.theme-choice-preview span:last-child{border-radius:3px}
.theme-choice-preview-light{background:#eef1f4}.theme-choice-preview-light span:first-child{background:#fff}.theme-choice-preview-light span:last-child{background:#fff}
.theme-choice-preview-dark{background:#151b23}.theme-choice-preview-dark span:first-child{background:#232d39}.theme-choice-preview-dark span:last-child{background:#202832}

/* Appearance color editor */
.settings-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.theme-color-layout{display:grid;grid-template-columns:minmax(420px,1.25fr) minmax(280px,.75fr);gap:24px;align-items:start}
.theme-color-grid{display:grid;grid-template-columns:repeat(2,minmax(190px,1fr));gap:12px}
.theme-color-field{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--am-border);border-radius:7px;background:var(--am-surface)}
.theme-color-input{display:grid;grid-template-columns:52px 1fr;gap:9px;align-items:center}
.theme-color-input input[type="color"]{width:52px;height:36px;padding:2px;cursor:pointer}
.theme-color-input code{padding:7px 8px;border:1px solid var(--am-border);border-radius:4px;background:color-mix(in srgb,var(--am-page-bg) 75%,var(--am-surface))}
.theme-live-preview{position:sticky;top:75px;padding:14px;border:1px solid var(--am-border);border-radius:8px;background:var(--am-surface)}
.theme-preview-window{overflow:hidden;height:230px;border:1px solid var(--preview-border,#d7dde3);border-radius:7px;background:var(--preview-page-bg,#f2f4f6)}
.theme-preview-header{height:35px;background:var(--preview-header,#063c66)}
.theme-preview-body{display:grid;grid-template-columns:25% 1fr;height:195px}
.theme-preview-nav{background:var(--preview-navigation,#fff);border-right:1px solid var(--preview-border,#d7dde3)}
.theme-preview-content{padding:16px}
.theme-preview-card{height:95px;border:1px solid var(--preview-border,#d7dde3);border-radius:5px;background:var(--preview-surface,#fff)}
.theme-preview-buttons{display:flex;gap:8px;margin-top:15px}
.theme-preview-buttons i{width:44px;height:20px;border-radius:4px;background:var(--preview-primary,#0878bd)}
.theme-preview-buttons i:nth-child(2){background:var(--preview-success,#198754)}
.theme-preview-buttons i:nth-child(3){background:var(--preview-danger,#b42318)}

/* Dark mode */
html[data-theme="dark"]{
  color-scheme:dark;
  --am-page-bg:#11161d;
  --am-surface:#1c242e;
  --am-text:#e7edf3;
  --am-border:#3a4755;
  --am-navigation:#18212b;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app-content{background:#11161d;color:#e7edf3}
html[data-theme="dark"] .main-header{background:color-mix(in srgb,var(--am-header) 70%,#101820)}
html[data-theme="dark"] .side-nav,
html[data-theme="dark"] .settings-hover-menu,
html[data-theme="dark"] .user-menu-panel{background:#18212b;color:#e7edf3;border-color:#3a4755}
html[data-theme="dark"] .side-nav a,
html[data-theme="dark"] .user-menu-panel a,
html[data-theme="dark"] .settings-hover-menu a{color:#e7edf3 !important}
html[data-theme="dark"] .side-nav a:hover,
html[data-theme="dark"] .user-menu-panel a:hover,
html[data-theme="dark"] .settings-hover-menu a:hover{background:#273442 !important;color:#fff !important}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] dialog,
html[data-theme="dark"] .tree-card,
html[data-theme="dark"] .management-table-scroll,
html[data-theme="dark"] .sticky-table{background:#1c242e;color:#e7edf3;border-color:#3a4755}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#131a22;color:#edf3f8;border-color:#465463}
html[data-theme="dark"] table,
html[data-theme="dark"] td{background:#1c242e;color:#e7edf3;border-color:#3a4755}
html[data-theme="dark"] th{background:#293541;color:#f3f6f9;border-color:#465463}
html[data-theme="dark"] .column-filter-row th{background:#232e39}
html[data-theme="dark"] .column-filter-row th.filter-cell-active{background:#554612}
html[data-theme="dark"] .column-filter-row input.filter-input-active{background:#493d14;color:#fff2b3;border-color:#d4a735}
html[data-theme="dark"] .filters a{background:#1c242e;color:#8dcbf1;border-color:#3a4755}
html[data-theme="dark"] .table-filter-status.is-active{background:#403715;color:#ffeb9e;border-color:#a98b2d}
html[data-theme="dark"] .table-filter-status-details{color:#ddca86}
html[data-theme="dark"] .notice{background:#493d14;color:#fff0ad;border-color:#7a6721}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .table-hint,
html[data-theme="dark"] small{color:#aeb9c5}
html[data-theme="dark"] code{background:#121820;color:#dbe8f2}
html[data-theme="dark"] .tree-category-options{background:#151d25;border-color:#3a4755}
html[data-theme="dark"] .tree-category-option{background:#1c242e;color:#e7edf3;border-color:#3a4755}
html[data-theme="dark"] .tree-category-option:hover{background:#26323e}
html[data-theme="dark"] .tree-category-option:has(input:checked){background:#263a49;border-color:#5f9ac0}
html[data-theme="dark"] .backup-empty-state{background:#151d25;border-color:#465463}
html[data-theme="dark"] .theme-color-field,
html[data-theme="dark"] .theme-live-preview{background:#18212b}

@media(max-width:900px){
  .theme-color-layout{grid-template-columns:1fr}
  .theme-live-preview{position:static}
}
@media(max-width:600px){
  .theme-color-grid,.theme-mode-choice{grid-template-columns:1fr}
  .settings-section-heading{flex-direction:column}
}


/* v0.4.0.10: Dark-mode cleanup and configurable borders/surfaces */

/* Settings sections and forms must use configured surface/border colors. */
.settings-form,
.settings-section,
.settings-subsection,
.auth-card,
.profile-panel,
.panel{
  background:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
}

.settings-form{
  border-color:transparent;
}

.settings-section{
  box-shadow:none;
}

/* Language and user dropdowns */
.language-menu .user-menu-panel,
.user-menu .user-menu-panel{
  background:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
}

.language-menu .menu-button,
.user-menu .menu-button{
  width:100%;
  background:transparent;
  color:var(--am-text);
  border:0;
  text-align:left;
}

.language-menu .menu-button:hover,
.user-menu .menu-button:hover,
.language-menu .menu-button.active,
.user-menu .menu-button.active{
  background:color-mix(in srgb,var(--am-primary) 18%,var(--am-surface));
  color:var(--am-text);
}

html[data-theme="dark"] .language-menu .user-menu-panel,
html[data-theme="dark"] .user-menu .user-menu-panel{
  background:#18212b;
  color:#e7edf3;
  border-color:#3a4755;
}

html[data-theme="dark"] .language-menu .menu-button,
html[data-theme="dark"] .user-menu .menu-button{
  background:transparent;
  color:#e7edf3;
}

html[data-theme="dark"] .language-menu .menu-button:hover,
html[data-theme="dark"] .user-menu .menu-button:hover,
html[data-theme="dark"] .language-menu .menu-button.active,
html[data-theme="dark"] .user-menu .menu-button.active{
  background:#273442;
  color:#ffffff;
}

/* Asset-tree category text and switch */
.tree-category-filter,
.tree-category-options,
.tree-category-option,
.tree-toggle-option{
  color:var(--am-text);
  border-color:var(--am-border);
}

.tree-category-filter{
  background:var(--am-surface);
}

.tree-category-filter legend,
.tree-category-name,
.tree-toggle-text{
  color:var(--am-text);
}

.tree-category-options{
  background:color-mix(in srgb,var(--am-page-bg) 72%,var(--am-surface));
}

.tree-category-option,
.tree-toggle-option{
  background:var(--am-surface);
}

.tree-category-option:hover,
.tree-toggle-option:hover{
  background:color-mix(in srgb,var(--am-primary) 8%,var(--am-surface));
}

.tree-category-option:has(input:checked){
  background:color-mix(in srgb,var(--am-primary) 14%,var(--am-surface));
  border-color:var(--am-primary);
}

html[data-theme="dark"] .tree-category-filter{
  background:#1c242e;
  border-color:#3a4755;
}

html[data-theme="dark"] .tree-category-filter legend,
html[data-theme="dark"] .tree-category-name,
html[data-theme="dark"] .tree-toggle-text{
  color:#e7edf3;
}

html[data-theme="dark"] .tree-category-options{
  background:#151d25;
  border-color:#3a4755;
}

html[data-theme="dark"] .tree-category-option,
html[data-theme="dark"] .tree-toggle-option{
  background:#1c242e;
  color:#e7edf3;
  border-color:#3a4755;
}

html[data-theme="dark"] .tree-category-option:hover,
html[data-theme="dark"] .tree-toggle-option:hover{
  background:#26323e;
}

html[data-theme="dark"] .tree-category-option:has(input:checked){
  background:#263a49;
  border-color:#5f9ac0;
}

/* Prevent light remnants from native-looking fieldsets/cards */
fieldset,
legend{
  color:var(--am-text);
  border-color:var(--am-border);
}

html[data-theme="dark"] fieldset{
  background:transparent;
  border-color:#3a4755;
}

html[data-theme="dark"] legend{
  color:#e7edf3;
}


/* v0.4.0.11: comprehensive dark-mode surfaces */

/* General application surfaces */
html[data-theme="dark"] form:not(.inline-form):not(.header-theme-form):not(.backup-create-form){
  background:#1c242e;
  color:#e7edf3;
  border-color:#3a4755;
}

html[data-theme="dark"] .compact-form,
html[data-theme="dark"] .user-permission-form,
html[data-theme="dark"] .translation-filter-form,
html[data-theme="dark"] .backup-upload-form,
html[data-theme="dark"] .chart-form,
html[data-theme="dark"] .settings-form{
  background:#1c242e !important;
  color:#e7edf3;
  border-color:#3a4755 !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .cards .card,
html[data-theme="dark"] .sync-summary-card,
html[data-theme="dark"] .backup-summary-card,
html[data-theme="dark"] .backup-content-note,
html[data-theme="dark"] .backup-upload-form,
html[data-theme="dark"] .backup-table-wrap,
html[data-theme="dark"] .translation-filter-panel,
html[data-theme="dark"] .translation-selection-actions,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .detail,
html[data-theme="dark"] .config-list,
html[data-theme="dark"] .logo-preview,
html[data-theme="dark"] .settings-subsection{
  background:#1c242e !important;
  color:#e7edf3 !important;
  border-color:#3a4755 !important;
}

html[data-theme="dark"] .card strong,
html[data-theme="dark"] .card small,
html[data-theme="dark"] .backup-summary-label,
html[data-theme="dark"] .backup-summary-card strong,
html[data-theme="dark"] .backup-content-note p{
  color:#e7edf3 !important;
}

/* Forms, controls and browser-native file inputs */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#131a22 !important;
  color:#edf3f8 !important;
  border-color:#465463 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color:#93a1ae !important;
  opacity:1;
}

html[data-theme="dark"] input[type="file"]{
  background:#131a22 !important;
  color:#dfe7ee !important;
}

html[data-theme="dark"] input[type="file"]::file-selector-button{
  background:#526678;
  color:#fff;
  border:0;
  border-radius:4px;
  padding:6px 10px;
  margin-right:10px;
  cursor:pointer;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"]{
  accent-color:var(--am-primary);
}

/* MeshCentral synchronization */
html[data-theme="dark"] .sync-status,
html[data-theme="dark"] .status-success,
html[data-theme="dark"] .status-synced,
html[data-theme="dark"] .status-created,
html[data-theme="dark"] .status-updated{
  background:#244631;
  color:#bce8c9;
}

html[data-theme="dark"] .status-conflict,
html[data-theme="dark"] .status-partial{
  background:#4d411b;
  color:#ffe68d;
}

html[data-theme="dark"] .status-error,
html[data-theme="dark"] .status-missing{
  background:#552828;
  color:#ffc2c2;
}

html[data-theme="dark"] .log-box,
html[data-theme="dark"] .sync-log,
html[data-theme="dark"] pre{
  background:#101722 !important;
  color:#dce8f4 !important;
  border-color:#3a4755 !important;
}

/* Backup page */
html[data-theme="dark"] .backup-summary-card{
  box-shadow:none;
}

html[data-theme="dark"] .backup-summary-icon{
  background:#283544;
  color:#d9e7f2;
}

html[data-theme="dark"] .backup-status-badge,
html[data-theme="dark"] .backup-count{
  background:#244631;
  color:#c5efd0;
}

html[data-theme="dark"] .backup-table th{
  background:#293541;
  color:#f2f6f9;
}

html[data-theme="dark"] .backup-empty-state{
  background:#151d25 !important;
  color:#dbe5ed;
  border-color:#465463;
}

/* Categories and status values */
html[data-theme="dark"] .category-attributes .attribute-badge,
html[data-theme="dark"] .category-attributes span{
  background:#253443;
  color:#dbeaf4;
  border-color:#486071;
}

html[data-theme="dark"] .category-attributes span:hover{
  background:#304456;
}

html[data-theme="dark"] .categories-table form,
html[data-theme="dark"] .data-table form{
  background:transparent !important;
  border:0 !important;
  color:inherit;
}

html[data-theme="dark"] .data-table input,
html[data-theme="dark"] .data-table select,
html[data-theme="dark"] .data-table textarea{
  background:#131a22 !important;
  color:#edf3f8 !important;
  border-color:#465463 !important;
}

/* Translations */
html[data-theme="dark"] .translation-filter-panel,
html[data-theme="dark"] .translation-filter-form,
html[data-theme="dark"] .translation-selection-actions{
  background:#1c242e !important;
}

html[data-theme="dark"] .translation-filter-checkbox,
html[data-theme="dark"] .translation-filter-checkbox span,
html[data-theme="dark"] .translation-filter-checkbox label{
  color:#e7edf3 !important;
}

html[data-theme="dark"] .translations-table textarea,
html[data-theme="dark"] .table-wrap textarea{
  background:#131a22 !important;
  color:#edf3f8 !important;
}

/* User management */
html[data-theme="dark"] .user-permission-form,
html[data-theme="dark"] .user-permission-form fieldset,
html[data-theme="dark"] .group-checkboxes,
html[data-theme="dark"] .checkbox-row{
  background:transparent !important;
  color:#e7edf3 !important;
  border-color:#465463 !important;
}

html[data-theme="dark"] .user-permission-form label,
html[data-theme="dark"] .group-checkboxes label,
html[data-theme="dark"] .checkbox-row label,
html[data-theme="dark"] .checkbox-label{
  color:#e7edf3 !important;
}

html[data-theme="dark"] .user-inline-form{
  background:transparent !important;
}

/* Remove remaining bright strips and native white surfaces */
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .sticky-table,
html[data-theme="dark"] .management-table-scroll{
  background:#1c242e !important;
  border-color:#3a4755 !important;
}

html[data-theme="dark"] hr{
  border-color:#3a4755;
}

html[data-theme="dark"] .logo-preview img{
  background:#151d25;
  border-color:#465463;
}

/* Explicitly keep action forms transparent */
html[data-theme="dark"] .inline-form,
html[data-theme="dark"] .backup-actions form,
html[data-theme="dark"] .row-actions form,
html[data-theme="dark"] .hidden-utility-form,
html[data-theme="dark"] .header-theme-form{
  background:transparent !important;
  border:0 !important;
}


/* v0.4.0.12: loading overlays, dialogs and progress indicators */

/* Asset-page loading overlay */
html.asset-page-booting .app-content{
  position:relative;
}

html.asset-page-booting .asset-page-loader{
  position:fixed;
  inset:58px 0 0 58px;
  z-index:4500;
  min-height:0;
  padding:24px;
  background:rgba(242,244,246,.82);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}

html.sidebar-collapsed-preset.asset-page-booting .asset-page-loader{
  left:58px;
}

.asset-page-loader-card{
  color:var(--am-text);
  background:var(--am-surface);
  border-color:var(--am-border);
  box-shadow:0 16px 42px rgba(0,0,0,.22);
}

.asset-page-loader-card strong{
  color:var(--am-text);
}

.asset-page-loader-card .muted{
  color:color-mix(in srgb,var(--am-text) 68%,transparent);
}

.asset-page-spinner{
  color:var(--am-primary);
  border-color:color-mix(in srgb,var(--am-border) 78%,transparent);
  border-top-color:var(--am-primary);
}

/* Generic native dialogs and modal overlays */
dialog{
  color:var(--am-text);
  background:var(--am-surface);
  border:1px solid var(--am-border);
}

dialog::backdrop{
  background:rgba(18,26,34,.62);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}

dialog form{
  color:var(--am-text);
  background:transparent;
}

/* HTML progress elements */
progress{
  width:100%;
  height:12px;
  overflow:hidden;
  border:0;
  border-radius:999px;
  background:color-mix(in srgb,var(--am-border) 60%,var(--am-surface));
  color:var(--am-primary);
}

progress::-webkit-progress-bar{
  background:color-mix(in srgb,var(--am-border) 60%,var(--am-surface));
  border-radius:999px;
}

progress::-webkit-progress-value{
  background:var(--am-primary);
  border-radius:999px;
}

progress::-moz-progress-bar{
  background:var(--am-primary);
  border-radius:999px;
}

/* Common custom progress bars */
.progress,
.progress-track,
.loading-progress{
  background:color-mix(in srgb,var(--am-border) 60%,var(--am-surface));
  border-color:var(--am-border);
}

.progress-bar,
.progress-value,
.loading-progress-bar{
  background:var(--am-primary);
}

/* Dark mode */
html[data-theme="dark"].asset-page-booting .asset-page-loader{
  background:rgba(8,12,17,.84);
}

html[data-theme="dark"] .asset-page-loader-card{
  background:#1c242e;
  color:#e7edf3;
  border-color:#465463;
  box-shadow:0 18px 50px rgba(0,0,0,.55);
}

html[data-theme="dark"] .asset-page-loader-card strong{
  color:#f3f7fa;
}

html[data-theme="dark"] .asset-page-loader-card .muted{
  color:#aeb9c5;
}

html[data-theme="dark"] .asset-page-spinner{
  color:var(--am-primary);
  border-color:#465463;
  border-top-color:var(--am-primary);
}

html[data-theme="dark"] dialog{
  background:#1c242e;
  color:#e7edf3;
  border-color:#465463;
  box-shadow:0 20px 60px rgba(0,0,0,.62);
}

html[data-theme="dark"] dialog::backdrop{
  background:rgba(4,7,10,.76);
}

html[data-theme="dark"] progress,
html[data-theme="dark"] progress::-webkit-progress-bar,
html[data-theme="dark"] .progress,
html[data-theme="dark"] .progress-track,
html[data-theme="dark"] .loading-progress{
  background:#2a3541;
}

@media(max-width:900px){
  html.asset-page-booting .asset-page-loader{
    left:0;
    inset:58px 0 0 0;
  }
}


/* v0.4.0.13: system-wide themed scrollbars */

/* Firefox */
*{
  scrollbar-width:thin;
  scrollbar-color:
    color-mix(in srgb,var(--am-text) 34%,var(--am-border))
    color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
}

/* Chromium, Edge and Safari */
*::-webkit-scrollbar{
  width:12px;
  height:12px;
}

*::-webkit-scrollbar-track{
  background:color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
  border-radius:999px;
}

*::-webkit-scrollbar-thumb{
  background:color-mix(in srgb,var(--am-text) 34%,var(--am-border));
  border:3px solid color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
  border-radius:999px;
  min-height:28px;
}

*::-webkit-scrollbar-thumb:hover{
  background:color-mix(in srgb,var(--am-primary) 65%,var(--am-text));
}

*::-webkit-scrollbar-thumb:active{
  background:var(--am-primary);
}

*::-webkit-scrollbar-corner{
  background:color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
}

/* Main scrollable application areas */
#asset-table-scroll,
#asset-table-scroll-top,
.management-table-scroll,
.sticky-table,
.table-scroll,
.table-wrap,
.tree-scroll,
.tree-category-options,
.log-box,
.sync-log,
pre,
textarea,
dialog,
.user-menu-panel,
.settings-hover-menu{
  scrollbar-color:
    color-mix(in srgb,var(--am-text) 34%,var(--am-border))
    color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
}

/* Top horizontal scrollbar on the asset table */
#asset-table-scroll-top{
  background:var(--am-surface);
  border-color:var(--am-border);
}

#asset-table-scroll-top > div{
  background:transparent;
}

/* Dark mode */
html[data-theme="dark"] *{
  scrollbar-color:#667789 #18212b;
}

html[data-theme="dark"] *::-webkit-scrollbar-track{
  background:#18212b;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb{
  background:#667789;
  border-color:#18212b;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover{
  background:#7f94a8;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:active{
  background:var(--am-primary);
}

html[data-theme="dark"] *::-webkit-scrollbar-corner{
  background:#18212b;
}

html[data-theme="dark"] #asset-table-scroll-top{
  background:#1c242e;
  border-color:#3a4755;
}

/* Stronger contrast for large table/tree scroll containers */
html[data-theme="dark"] #asset-table-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] #asset-table-scroll-top::-webkit-scrollbar-thumb,
html[data-theme="dark"] .management-table-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] .tree-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] .tree-category-options::-webkit-scrollbar-thumb{
  background:#718398;
}

html[data-theme="dark"] #asset-table-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] #asset-table-scroll-top::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .management-table-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .tree-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .tree-category-options::-webkit-scrollbar-thumb:hover{
  background:#8ba0b5;
}

/* Light mode contrast */
html[data-theme="light"] *{
  scrollbar-color:#8799a8 #e8edf1;
}

html[data-theme="light"] *::-webkit-scrollbar-track{
  background:#e8edf1;
}

html[data-theme="light"] *::-webkit-scrollbar-thumb{
  background:#8799a8;
  border-color:#e8edf1;
}

html[data-theme="light"] *::-webkit-scrollbar-thumb:hover{
  background:#6f8292;
}

/* v0.5.0.0 job states */
.job-status{display:inline-flex;align-items:center;min-height:24px;padding:2px 9px;border:1px solid var(--am-border);border-radius:999px;background:color-mix(in srgb,var(--am-surface) 80%,var(--am-page-bg));color:var(--am-text);font-size:.82rem;font-weight:700;white-space:nowrap}
.job-status-success{background:color-mix(in srgb,var(--am-success) 18%,var(--am-surface))}
.job-status-failed,.job-status-timeout,.job-status-cancelled{background:color-mix(in srgb,var(--am-danger) 18%,var(--am-surface))}
.job-status-partial{background:color-mix(in srgb,var(--am-warning) 18%,var(--am-surface))}
.job-status-created,.job-status-sending,.job-status-sent,.job-status-running{background:color-mix(in srgb,var(--am-primary) 16%,var(--am-surface))}
html[data-theme="dark"] .job-status-success{background:#244631;color:#bce8c9}html[data-theme="dark"] .job-status-failed,html[data-theme="dark"] .job-status-timeout,html[data-theme="dark"] .job-status-cancelled{background:#552828;color:#ffc2c2}html[data-theme="dark"] .job-status-partial{background:#4d411b;color:#ffe68d}html[data-theme="dark"] .job-status-created,html[data-theme="dark"] .job-status-sending,html[data-theme="dark"] .job-status-sent,html[data-theme="dark"] .job-status-running{background:#203d55;color:#b9dcf5}


/* v0.5.0.1: full-width backup management */
.backup-page{
  width:100%;
  max-width:none;
}
.backup-table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
}
.backup-table{
  width:100%;
  min-width:980px;
}

/* v0.5.0.1: software settings */
.software-settings-page{
  width:100%;
  max-width:none;
}
.software-settings-header{
  align-items:flex-start;
}
.software-settings-header h1{
  margin-bottom:6px;
}
.software-settings-form{
  padding:0;
  border:0;
  background:transparent;
}
.software-settings-section{
  margin-bottom:18px;
}
.software-settings-section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.software-settings-section-heading h2{
  margin:0 0 6px;
}
.software-settings-section-heading p{
  margin:0;
}
.software-settings-badge{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  background:color-mix(in srgb,var(--am-primary) 16%,var(--am-surface));
  border:1px solid color-mix(in srgb,var(--am-primary) 38%,var(--am-border));
  font-size:.78rem;
  font-weight:700;
  white-space:nowrap;
}
.software-settings-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.software-settings-wide{
  grid-column:1/-1;
}
.software-settings-grid label{
  min-width:0;
}
.software-settings-grid label > small{
  display:block;
  margin-top:6px;
}
.software-toggle-option{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:74px;
  padding:12px 14px;
  border:1px solid var(--am-border);
  border-radius:8px;
  background:color-mix(in srgb,var(--am-surface) 88%,var(--am-page-bg));
  cursor:pointer;
}
.software-toggle-option > input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.software-toggle-track{
  position:relative;
  flex:0 0 40px;
  width:40px;
  height:23px;
  border-radius:999px;
  background:color-mix(in srgb,var(--am-text) 35%,var(--am-surface));
}
.software-toggle-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:17px;
  height:17px;
  border-radius:50%;
  background:var(--am-surface);
  box-shadow:0 1px 3px rgba(0,0,0,.35);
  transition:transform .15s ease;
}
.software-toggle-option input:checked + .software-toggle-track{
  background:var(--am-primary);
}
.software-toggle-option input:checked + .software-toggle-track .software-toggle-thumb{
  transform:translateX(17px);
}
.software-toggle-option input:focus-visible + .software-toggle-track{
  outline:2px solid var(--am-primary);
  outline-offset:3px;
}
.software-toggle-option > span:last-child{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.software-callback-preview,
.software-debug-path{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:14px 16px;
  border:1px solid var(--am-border);
  border-radius:8px;
  background:color-mix(in srgb,var(--am-surface) 82%,var(--am-page-bg));
}
.software-callback-preview code,
.software-debug-path code{
  overflow-wrap:anywhere;
}
.software-settings-actions{
  margin:0 0 20px;
}
.software-debug-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:10px;
}
.software-debug-log{
  min-height:280px;
  max-height:520px;
  margin:0;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.software-future-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.software-future-grid span{
  padding:12px 14px;
  border:1px dashed var(--am-border);
  border-radius:7px;
  background:color-mix(in srgb,var(--am-surface) 86%,var(--am-page-bg));
}
html[data-theme="dark"] .software-toggle-thumb{
  background:#eef2f6;
}
@media(max-width:900px){
  .software-settings-grid,
  .software-future-grid{
    grid-template-columns:1fr;
  }
  .software-settings-wide{
    grid-column:auto;
  }
  .software-settings-section-heading,
  .software-debug-toolbar{
    flex-direction:column;
  }
}

/* v0.5.0.3 log controls */
.software-log-heading,
.software-debug-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.software-log-heading h2,
.software-log-heading h3{
  margin:0;
}
.software-log-heading{
  margin-bottom:10px;
}
.software-debug-actions{
  justify-content:flex-end;
}
@media(max-width:700px){
  .software-log-heading{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* v0.5.0.4 software inventory initialization */
.software-inventory-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.software-inventory-heading h2{
  margin:0 0 5px;
}
.software-inventory-heading p{
  margin:0;
}
.software-inventory-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  height:34px;
  padding:0 11px;
  border-radius:999px;
  border:1px solid color-mix(in srgb,var(--am-primary) 42%,var(--am-border));
  background:color-mix(in srgb,var(--am-primary) 16%,var(--am-surface));
  font-weight:700;
}
.software-empty-inventory{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  padding:28px 16px;
  text-align:center;
}
.software-exclusion-preview{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.software-exclusion-preview span{
  padding:12px 14px;
  border:1px dashed var(--am-border);
  border-radius:7px;
  background:color-mix(in srgb,var(--am-surface) 86%,var(--am-page-bg));
}
@media(max-width:800px){
  .software-exclusion-preview{
    grid-template-columns:1fr;
  }
}

/* v0.5.0.5 central and asset software lists */
.asset-software-toolbar,
.software-section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.asset-software-toolbar h3,
.software-section-heading h2{
  margin:0 0 5px;
}
.asset-software-toolbar p,
.software-section-heading p{
  margin:0;
}
.software-inventory-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px 24px;
  margin:0 0 16px;
  padding:12px 14px;
  border:1px solid var(--am-border);
  border-radius:7px;
  background:color-mix(in srgb,var(--am-surface) 86%,var(--am-page-bg));
}
.software-summary-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.software-summary-card{
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:17px 18px;
  border:1px solid var(--am-border);
  border-radius:8px;
  background:var(--am-surface);
}
.software-summary-card span{
  color:color-mix(in srgb,var(--am-text) 68%,transparent);
}
.software-summary-card strong{
  font-size:1.65rem;
}
@media(max-width:800px){
  .asset-software-toolbar,
  .software-section-heading{
    flex-direction:column;
  }
  .software-summary-cards{
    grid-template-columns:1fr;
  }
}


/* v0.5.0.6: dedicated software pages */
.software-summary-link{
  color:inherit;
  text-decoration:none;
  transition:border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.software-summary-link:hover{
  color:inherit;
  border-color:color-mix(in srgb,var(--am-primary) 50%,var(--am-border));
  transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(0,0,0,.08);
}
.software-summary-link small{
  color:color-mix(in srgb,var(--am-text) 65%,transparent);
}
.software-list-links{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.software-list-link{
  display:grid;
  grid-template-columns:1fr auto;
  gap:7px 16px;
  align-items:center;
  padding:16px;
  border:1px solid var(--am-border);
  border-radius:8px;
  background:color-mix(in srgb,var(--am-surface) 88%,var(--am-page-bg));
  color:var(--am-text);
  text-decoration:none;
}
.software-list-link strong,
.software-list-link > span:not(.button){
  grid-column:1;
}
.software-list-link .button{
  grid-column:2;
  grid-row:1/3;
}
.software-dedicated-table{
  max-height:calc(100vh - 230px);
  overflow:auto;
}
@media(max-width:800px){
  .software-list-links{
    grid-template-columns:1fr;
  }
}

/* v0.5.0.6: dark mode inventory text */
html[data-theme="dark"] .inventory-panel,
html[data-theme="dark"] .inventory-panel h2,
html[data-theme="dark"] .inventory-panel h3,
html[data-theme="dark"] .inventory-header,
html[data-theme="dark"] .inventory-meta,
html[data-theme="dark"] .inventory-tab-content,
html[data-theme="dark"] .asset-software-toolbar,
html[data-theme="dark"] .software-inventory-meta{
  color:var(--am-text) !important;
}
html[data-theme="dark"] .inventory-tab{
  color:#d7e0e8 !important;
  background:transparent;
}
html[data-theme="dark"] .inventory-tab:hover{
  color:#ffffff !important;
  background:rgba(255,255,255,.06);
}
html[data-theme="dark"] .inventory-tab.active{
  color:#ffffff !important;
  background:color-mix(in srgb,var(--am-primary) 24%,transparent);
  border-bottom-color:var(--am-primary);
}
html[data-theme="dark"] .inventory-tab-content .empty-state{
  color:#cbd5df;
}
html[data-theme="dark"] .inventory-tab-content .empty-state strong{
  color:#f2f5f8;
}

/* v0.5.0.6: dark mode toasts */
html[data-theme="dark"] .toast{
  color:#edf2f7;
  background:#202a34;
  border-color:#465462;
  box-shadow:0 .55rem 1.6rem rgba(0,0,0,.48);
}
html[data-theme="dark"] .toast-message{
  color:#edf2f7;
}
html[data-theme="dark"] .toast-close{
  color:#dbe4ec;
}
html[data-theme="dark"] .toast-close:hover{
  color:#ffffff;
  background:rgba(255,255,255,.08);
}
html[data-theme="dark"] .toast-success{
  background:#20382b;
  border-left-color:#58c77b;
}
html[data-theme="dark"] .toast-warning{
  background:#453818;
  border-left-color:#e7b94e;
}
html[data-theme="dark"] .toast-error{
  background:#482626;
  border-left-color:#ef7373;
}
html[data-theme="dark"] .toast-success .toast-symbol{color:#8be5a5}
html[data-theme="dark"] .toast-warning .toast-symbol{color:#f4d37d}
html[data-theme="dark"] .toast-error .toast-symbol{color:#ff9b9b}


/* v0.5.0.7 MeshCentral presence */
.presence-badge{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:27px;
  padding:3px 9px;
  border:1px solid var(--am-border);
  border-radius:999px;
  background:color-mix(in srgb,var(--am-surface) 86%,var(--am-page-bg));
  color:var(--am-text);
  font-size:.78rem;
  font-weight:700;
  white-space:nowrap;
}
.presence-dot{
  width:9px;
  height:9px;
  flex:0 0 9px;
  border-radius:50%;
  background:#8b98a5;
  box-shadow:0 0 0 3px rgba(139,152,165,.15);
}
.presence-online{
  border-color:color-mix(in srgb,var(--am-success) 50%,var(--am-border));
  background:color-mix(in srgb,var(--am-success) 15%,var(--am-surface));
}
.presence-online .presence-dot{
  background:#23a455;
  box-shadow:0 0 0 3px rgba(35,164,85,.18);
}
.presence-offline{
  border-color:color-mix(in srgb,var(--am-danger) 42%,var(--am-border));
  background:color-mix(in srgb,var(--am-danger) 11%,var(--am-surface));
}
.presence-offline .presence-dot{
  background:#c43d3d;
  box-shadow:0 0 0 3px rgba(196,61,61,.16);
}
.presence-unknown .presence-dot{
  background:#8b98a5;
}
html[data-theme="dark"] .presence-online{
  background:#203d2b;
  color:#bce8c9;
}
html[data-theme="dark"] .presence-offline{
  background:#482727;
  color:#ffc2c2;
}
html[data-theme="dark"] .presence-unknown{
  background:#2b3540;
  color:#d4dde5;
}


/* v0.5.0.8 column management dark mode */
html[data-theme="dark"] .column-context-menu{
  background:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
  box-shadow:0 12px 30px rgba(0,0,0,.45);
}
html[data-theme="dark"] .column-context-menu button{
  background:transparent;
  color:var(--am-text);
  border-color:transparent;
}
html[data-theme="dark"] .column-context-menu button:hover,
html[data-theme="dark"] .column-context-menu button:focus-visible{
  background:var(--am-hover);
  color:var(--am-link);
}
html[data-theme="dark"] .column-settings-dialog,
html[data-theme="dark"] .column-settings-dialog form{
  background:var(--am-surface);
  color:var(--am-text);
}
html[data-theme="dark"] .column-settings-list label{
  background:var(--am-surface-2,var(--am-page-bg));
  color:var(--am-text);
  border-color:var(--am-border);
}
html[data-theme="dark"] .column-settings-list label:hover{
  background:var(--am-hover);
}


/* v0.5.0.9 bulk job selector */
.bulk-job-controls{
  display:inline-flex;
  align-items:stretch;
  gap:6px;
}
.bulk-job-type{
  min-width:190px;
  min-height:38px;
  padding:7px 34px 7px 10px;
  border:1px solid var(--am-border);
  border-radius:6px;
  background:var(--am-surface);
  color:var(--am-text);
  font:inherit;
}
.bulk-job-type:disabled{
  opacity:.55;
  cursor:not-allowed;
}
html[data-theme="dark"] .bulk-job-type{
  background:var(--am-surface);
  color:var(--am-text);
  border-color:var(--am-border);
  color-scheme:dark;
}
html[data-theme="dark"] .bulk-job-type option{
  background:var(--am-surface);
  color:var(--am-text);
}
@media (max-width:900px){
  .bulk-job-controls{
    width:100%;
  }
  .bulk-job-type{
    flex:1 1 auto;
    min-width:0;
  }
}


/* v0.5.1.0 general job model */
.job-data-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}
.job-data-grid>div{min-width:0}
.job-data-grid .sync-log{min-height:110px;max-height:340px}
@media(max-width:800px){.job-data-grid{grid-template-columns:1fr}}


/* v0.5.1.1 browser-local timestamps */
time.local-time{font:inherit;color:inherit;white-space:nowrap;}

/* v0.5.1.2 job restart controls */
.button-small{min-height:30px;padding:4px 9px;font-size:.9rem;white-space:nowrap}

/* v0.5.1.3 software inventory selection */
.software-delete-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:0 0 12px;flex-wrap:wrap}.software-delete-toolbar .button-danger{background:#b42318;color:#fff;border-color:#b42318}.software-delete-toolbar .button-danger:disabled{opacity:.5;cursor:not-allowed}html[data-theme="dark"] .software-delete-toolbar .button-danger{background:#d92d20;border-color:#d92d20;color:#fff}

/* Category field bulk management (v0.5.1.7) */
.wide-dialog { width: min(920px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
.dialog-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.dialog-tabs .is-active { font-weight: 700; outline: 2px solid currentColor; }
.field-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .45rem 1rem; max-height: 45vh; overflow: auto; padding: .5rem; border: 1px solid var(--border-color, #ccc); border-radius: .4rem; }
.settings-bulk-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 1fr); gap: .75rem 1rem; margin: 1rem 0; }
@media (max-width: 650px) { .settings-bulk-grid { grid-template-columns: 1fr; } }

.job-definition-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.job-definition-form label{display:flex;flex-direction:column;gap:.4rem}.job-definition-form .form-wide{grid-column:1/-1}.code-editor{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;line-height:1.45;tab-size:4;min-height:28rem}.checkbox-label{flex-direction:row!important;align-items:center}@media(max-width:800px){.job-definition-form{grid-template-columns:1fr}.job-definition-form .form-wide{grid-column:auto}}

/* v0.5.3.3: readable category initials in dark mode */
html[data-theme="dark"] .cards .card .placeholder{
  background:#e7f0f6;
  color:#173b55;
  text-shadow:none;
}

.job-enabled-top{justify-content:flex-start!important;width:auto!important;align-self:start}.job-enabled-top input{width:auto!important;margin:0}.job-parameters-editor{border-top:1px solid var(--border-color,#d8dde2);padding-top:1rem}.job-parameter-row{display:grid;grid-template-columns:1.1fr 1.4fr 1fr 1.2fr;gap:.75rem;padding:1rem;margin:.75rem 0;border:1px solid #d8dde2;border-radius:.5rem}.job-parameter-row .form-wide{grid-column:1/-1}.job-parameter-row .button-danger{align-self:end}.job-parameter-asset{margin:.75rem 0;border:1px solid #d8dde2;border-radius:.5rem;padding:.75rem}.job-parameter-asset summary{cursor:pointer}.job-asset-param{padding:.5rem 0;border-bottom:1px solid #d8dde2}@media(max-width:900px){.job-parameter-row{grid-template-columns:1fr}}

/* v0.5.3.8 asset job definition parameter list */
.job-definition-asset-list{display:grid;gap:.75rem;margin-top:1rem}
.job-parameter-asset>summary{display:flex;justify-content:space-between;align-items:center;gap:1rem;cursor:pointer;padding:.85rem 1rem}
.job-parameter-asset>summary span:first-child{display:flex;flex-direction:column;gap:.2rem}
.job-parameter-asset>summary small{font-weight:400}
.job-parameter-empty{padding:0 1rem 1rem}

/* v0.5.5.6 software job list size */
.software-job-limit-form{
  display:flex;
  align-items:center;
  gap:8px;
}
.software-job-limit-form label{
  margin:0;
  white-space:nowrap;
}
.software-job-limit-form select{
  width:auto;
  min-width:86px;
}

/* v0.5.5.7 bulk restart for recent jobs */
.software-job-heading-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.software-job-heading-actions #restart-selected-jobs-button:disabled{
  opacity:.5;
  cursor:not-allowed;
}
@media(max-width:700px){
  .software-job-heading-actions{
    width:100%;
    justify-content:flex-start;
  }
}

/* v0.5.5.9 optimized software lists and configurable aggregation */
.software-summary-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.software-grouping-form{
  display:flex;
  align-items:center;
  gap:8px;
}
.software-grouping-form label{
  margin:0;
  white-space:nowrap;
}
.software-grouping-form select{
  width:auto;
  min-width:260px;
}
@media(max-width:800px){
  .software-summary-controls{
    width:100%;
    justify-content:flex-start;
  }
  .software-grouping-form{
    width:100%;
    align-items:flex-start;
    flex-direction:column;
  }
  .software-grouping-form select{
    width:100%;
    min-width:0;
  }
}

/* v0.5.5.12: keep white record-count labels readable in dark mode */
html[data-theme="dark"] .record-count{
  background:#fff !important;
  color:#26323d !important;
  border-color:#c9d3dc !important;
}
/* v0.5.5.13: chart totals stay readable on the light badge in dark mode. */
html[data-theme="dark"] .chart-total{
  color:#111827 !important;
}

/* v0.5.5.14: active software inventory exclusion list */
.software-exclusion-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.software-exclusion-row{
  display:grid;
  grid-template-columns:minmax(150px,220px) minmax(280px,1fr) auto;
  align-items:end;
  gap:12px;
  padding:12px;
  border:1px solid var(--am-border);
  border-radius:8px;
  background:color-mix(in srgb,var(--am-surface) 90%,var(--am-page-bg));
}
.software-exclusion-row label{
  margin:0;
}
.software-exclusion-row label > span{
  display:block;
  margin-bottom:6px;
  font-weight:600;
}
.software-exclusion-remove{
  white-space:nowrap;
}
.software-exclusion-actions{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:12px;
}
@media (max-width:760px){
  .software-exclusion-row{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .software-exclusion-remove{
    justify-self:start;
  }
  .software-exclusion-actions{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* Asset job-status exclusion filter: checkboxes stay left-aligned and vertical. */
.job-filter-status-fieldset{border:1px solid var(--border-color,#415166);border-radius:8px;padding:.85rem 1rem;margin:0}.job-filter-status-fieldset legend{padding:0 .35rem;font-weight:700}.job-filter-status-options{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%;margin-top:.65rem}.job-filter-status-options .checkbox-label{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:.55rem!important;width:100%!important;max-width:none!important;text-align:left!important}.job-filter-status-options .checkbox-label input{flex:0 0 auto!important;margin:0!important}.job-filter-status-actions{justify-content:flex-start;margin-top:.75rem}

/* 0.5.5.19: multi-job asset filter */
.job-filter-job-options{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;width:100%;margin-top:.65rem}
.job-filter-job-options .checkbox-label{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:.55rem!important;width:100%!important;max-width:none!important;text-align:left!important}
.job-filter-job-options .checkbox-label input{flex:0 0 auto!important;margin:0!important}
.job-filter-start-choice{display:inline-flex;align-items:center;gap:.5rem;margin:0 .35rem}
.job-filter-start-choice select{min-width:220px}
.job-filter-source{display:block;margin-top:.3rem;line-height:1.25}

/* Administrator editor for the protected MeshCentral node ID. */
.mesh-node-id-editor{display:grid;gap:.55rem}.mesh-node-id-input{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.mesh-node-id-actions{display:flex;flex-wrap:wrap;gap:.55rem;align-items:center}.mesh-node-id-actions .button{width:auto;margin:0}.mesh-node-id-editor small{font-weight:400;margin:0}

/* Keep server-filter controls visible while only the table body is refreshed. */
table.server-filter-loading tbody{opacity:.55;transition:opacity .12s ease}

/* Privacy and retention settings */
.privacy-toolbar { align-items: flex-start; gap: 1rem; }
.privacy-phase-notice { margin-bottom: 1rem; }
.repeatable-list { display: grid; gap: .65rem; }
.repeatable-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; align-items: start; }
.repeatable-row textarea { min-height: 4rem; }
.privacy-category-workbook { border: 1px solid var(--border-color); border-radius: .7rem; background: var(--surface-color); overflow: hidden; }
.privacy-category-tabs { display: flex; align-items: flex-end; gap: .2rem; overflow-x: auto; padding: .55rem .55rem 0; background: color-mix(in srgb, var(--surface-color) 88%, var(--primary-color)); scrollbar-width: thin; }
.privacy-category-tab { flex: 0 0 auto; max-width: 260px; min-width: 120px; margin: 0; padding: .65rem .9rem; border: 1px solid transparent; border-bottom: 0; border-radius: .55rem .55rem 0 0; background: transparent; color: var(--text-color); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.privacy-category-tab:hover { background: color-mix(in srgb, var(--surface-color) 78%, var(--primary-color)); }
.privacy-category-tab.active { background: var(--surface-color); border-color: var(--border-color); color: var(--primary-color); }
.privacy-category-tab:focus-visible { outline: 2px solid var(--primary-color); outline-offset: -2px; }
.privacy-category-panels { min-height: 18rem; }
.privacy-category-panel { display: grid; gap: .8rem; padding: 1rem; }
.privacy-category-panel[hidden] { display: none !important; }
@media (max-width: 850px) { .privacy-toolbar { display: block; } .privacy-toolbar .toolbar-actions { margin-top: .75rem; } .privacy-category-tab { min-width: 105px; max-width: 200px; } }

.privacy-system-badge { margin-left: .35rem; font-size: .8rem; }
.privacy-retention-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; }
.privacy-system-note { margin-right: auto; }
.privacy-preview-result { display: grid; gap: .25rem; margin-top: 1rem; }
.privacy-settings-form[data-privacy-readonly="true"] input:disabled,
.privacy-settings-form[data-privacy-readonly="true"] textarea:disabled,
.privacy-settings-form[data-privacy-readonly="true"] select:disabled { opacity: 1; color: inherit; -webkit-text-fill-color: currentColor; cursor: default; }

/* First-start security notice shown while authentication is disabled. */
.authentication-disabled-banner{display:flex;align-items:flex-start;gap:.75rem;padding:.7rem 1.25rem;background:#fff3cd;border-bottom:1px solid #d9b650;color:#4a3a00;font-size:.92rem;line-height:1.35}
.authentication-disabled-banner strong{white-space:nowrap}
html[data-theme="dark"] .authentication-disabled-banner{background:#3b310d;border-bottom-color:#7f6a1d;color:#fff0ad}
@media(max-width:800px){.authentication-disabled-banner{flex-direction:column;gap:.25rem}.authentication-disabled-banner strong{white-space:normal}}

/* Active category / duplicate filters on the asset list. */
.asset-context-filter-details{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.asset-filter-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 7px;border:1px solid currentColor;border-radius:999px;background:rgba(255,255,255,.45)}
.asset-filter-chip-remove{display:inline-grid;place-items:center;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font:inherit;font-size:17px;line-height:1;cursor:pointer}
.asset-filter-chip-remove:hover,.asset-filter-chip-remove:focus-visible{background:rgba(0,0,0,.10);outline:none}
html[data-theme="dark"] .asset-filter-chip{background:rgba(0,0,0,.16)}
html[data-theme="dark"] .asset-filter-chip-remove:hover,html[data-theme="dark"] .asset-filter-chip-remove:focus-visible{background:rgba(255,255,255,.12)}

/* v0.5.5.41: generated visual row number column for data tables. */
.data-table .table-row-number-header,
.data-table .table-row-number-cell{
  width:1%;
  min-width:3.25rem;
  white-space:nowrap;
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.data-table .table-row-number-header{
  cursor:default;
}
.data-table .table-row-number-cell{
  color:var(--am-muted,#64748b);
  user-select:none;
}


/* Visual row-number column: readable by default and user-resizable per table. */
.data-table .table-row-number-header,
.data-table .table-row-number-filter,
.data-table .table-row-number-cell {
  width: var(--table-row-number-width, 64px);
  min-width: var(--table-row-number-width, 64px);
  max-width: var(--table-row-number-width, 64px);
  text-align: right;
  white-space: nowrap;
}
.data-table .table-row-number-header {
  position: relative;
  padding-right: 14px;
  overflow: visible;
}
.data-table .table-row-number-cell {
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
}
.data-table .table-row-number-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 9px;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
}
.data-table .table-row-number-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4px;
  border-left: 1px solid transparent;
}
.data-table .table-row-number-resizer:hover::after,
.data-table .table-row-number-resizer:focus-visible::after {
  border-left-color: currentColor;
}
html.table-column-resizing,
html.table-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}


/* User-resizable widths for every data-table column. */
table th.table-resizable-column-header {
  position: relative;
  padding-right: 14px;
  overflow: visible;
}
table .table-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 9px;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
}
table .table-column-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 4px;
  border-left: 1px solid transparent;
}
table .table-column-resizer:hover::after,
table .table-column-resizer:focus-visible::after {
  border-left-color: currentColor;
}


/* Asset list device preview: first real column after the generated row number. */
.asset-visual-column {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
}
.asset-visual-link { display:inline-flex; align-items:center; justify-content:center; width:48px; height:42px; }
.asset-list-device-image { max-width:46px; max-height:38px; width:auto; height:auto; object-fit:contain; border-radius:4px; }
.asset-list-device-placeholder { font-size:24px; opacity:.35; line-height:1; }
.mesh-icon-category-label { align-items:stretch; }
.mesh-icon-category-title { display:flex; align-items:center; gap:8px; min-height:38px; }
.mesh-icon-preview { width:38px; height:38px; object-fit:contain; flex:0 0 38px; }

/* v0.5.5.55 asset/category image management */
.asset-edit-image-preview{display:flex;align-items:center;gap:14px;margin:8px 0 10px;padding:10px;border:1px solid #d8dde2;border-radius:6px;background:var(--am-surface-soft,#f8fafc);max-width:520px}
.asset-edit-preview-image{width:110px;height:90px;object-fit:contain;border-radius:5px;background:transparent;border:1px solid #e1e5e9}
.asset-edit-image-preview-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.button-small{padding:7px 10px;font-size:.9rem}
.category-image-cell{text-align:center}
.category-table-image{width:52px;height:42px;object-fit:contain;border-radius:4px;display:inline-block;background:transparent}
html[data-theme="dark"] .asset-edit-image-preview{border-color:#46515d;background:#252b31}
html[data-theme="dark"] .asset-edit-preview-image{background:transparent;border-color:#4a5561}

/* v0.5.5.56: consistent transparent image presentation and reliable table resize handles. */
.asset-list-device-image,
.category-table-image,
.asset-edit-preview-image,
.card img {
  background: transparent !important;
}

.card img,
.asset-list-device-image,
.category-table-image,
.asset-edit-preview-image {
  object-fit: contain !important;
  object-position: center center;
}

table th.table-resizable-column-header {
  position: relative;
}
table th.table-resizable-column-header > .table-column-resizer {
  right: 0;
  width: 12px;
  z-index: 30;
}
table th.table-resizable-column-header > .table-column-resizer::after {
  left: auto;
  right: 0;
  border-left-color: color-mix(in srgb, currentColor 28%, transparent);
}
table th.table-resizable-column-header > .table-column-resizer:hover::after,
table th.table-resizable-column-header > .table-column-resizer:focus-visible::after {
  border-left-color: currentColor;
}

/* v0.5.5.57: universal table resize visibility and reliable image editor state. */
.asset-edit-image-preview[hidden],
.image-remove-pending[hidden] {
  display: none !important;
}
.image-remove-pending {
  margin: 8px 0 10px;
  padding: 9px 11px;
  max-width: 520px;
  border: 1px solid var(--am-warning, #d97706);
  border-radius: 6px;
  background: color-mix(in srgb, var(--am-warning, #d97706) 10%, transparent);
  font-size: .9rem;
}

/* Every resizable header has a permanent separator; the transparent hit area
   remains wider than the visible line for easy mouse/touch dragging. */
table th.table-resizable-column-header {
  position: relative !important;
  box-shadow: inset -1px 0 0 color-mix(in srgb, currentColor 28%, transparent);
}
table th.table-resizable-column-header > .table-column-resizer {
  display: block !important;
  pointer-events: auto !important;
  position: absolute !important;
  top: 0 !important;
  right: -5px !important;
  bottom: 0 !important;
  width: 11px !important;
  z-index: 100 !important;
  cursor: col-resize !important;
  touch-action: none;
  background: transparent;
}
table th.table-resizable-column-header:hover > .table-column-resizer::after,
table th.table-resizable-column-header > .table-column-resizer:focus-visible::after {
  border-left-color: currentColor !important;
}

/* Reusable standard image library */
.standard-image-library{margin-top:14px;padding-top:12px;border-top:1px solid var(--border,#d8dde2);max-width:760px}
.image-library-help,.image-library-empty{margin:4px 0 9px}
.standard-image-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;margin:8px 0 12px;max-height:330px;overflow:auto;padding:2px}
.standard-image-choice{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0;padding:7px;border:1px solid var(--border,#d8dde2);border-radius:7px;cursor:pointer;background:transparent}
.standard-image-choice:hover{border-color:var(--primary,#2583d8)}
.standard-image-choice:has(input:checked){outline:2px solid var(--primary,#2583d8);outline-offset:-2px}
.standard-image-choice input{position:absolute;top:6px;left:6px;margin:0}
.standard-image-choice img{width:72px;height:58px;object-fit:contain;background:transparent}
.standard-image-choice span{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:.78rem}
.image-upload-label{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin-top:8px}
html[data-theme="dark"] .standard-image-library{border-color:#46515d}
html[data-theme="dark"] .standard-image-choice{border-color:#46515d}
