:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #d7dbe8;
  --text: #1f2430;
  --muted: #5c6478;
  --primary: #2f5dff;
  --primary-strong: #2045cc;
  --secondary: #e8efff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: 98vw;
  margin: 2rem auto;
  display: grid;
  gap: 1.25rem;
}

.site-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.header-device-image {
  width: 100%;
  height: auto;
  opacity: 0.85;
}

.header-device-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: clamp(160px, 24vw, 320px);
}

.header-device-label {
  margin: 0;
  width: 100%;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.panel-card,
.overview,
.config-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.panel-card {
  padding: 1rem;
}

.card-header,
.config-header,
.device-toolbar,
.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.section-toggle-btn svg {
  transition: transform 0.2s ease;
}

.is-collapsed .section-toggle-btn svg {
  transform: rotate(-90deg);
}

.top-icon-actions {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 900;
  display: flex;
  gap: 0.5rem;
}

.top-icon-actions .icon-btn {
  width: 2.35rem;
  height: 2.35rem;
}

.top-icon-actions .icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.stats-fab {
  background: #fff;
}

#openStatsBtn {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

#openStatsBtn:hover {
  background: #bbf7d0;
}

.card-header h2,
.overview-header h2 {
  margin: 0;
}

.section-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.section-title-with-icon svg {
  width: 2.0rem;
  height: 2.0rem;
  color: #5c6478;
  flex: 0 0 auto;
}

.section-title-with-icon img {
  width: 2.0rem;
  height: 2.0rem;
  flex: 0 0 auto;
  opacity: 0.85;
}

.card-header {
  margin-bottom: 1.4rem;
}

.overview-header {
  margin-bottom: 1.4rem;
}

.config-card {
  padding: 0.75rem;
}

.config-card h3 {
  margin: 0 0 0.75rem;
}

.config-name-input {
  width: 100%;
  max-width: 280px;
}

.device-table-wrap,
#overviewTableWrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
}

.catalog-table {
  min-width: 1040px;
}

.catalog-table th:first-child,
.catalog-table td:first-child {
  width: 2rem;
}

.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2) {
  width: 10%;
}

.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3) {
  width: 10%;
}

.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) {
  width: 18%;
}

.catalog-table th:nth-child(n + 5):nth-child(-n + 10),
.catalog-table td:nth-child(n + 5):nth-child(-n + 10) {
  width: 4.4%;
}

.catalog-table th:nth-child(11),
.catalog-table td:nth-child(11),
.catalog-table th:nth-child(12),
.catalog-table td:nth-child(12) {
  width: 6.8%;
  min-width: 6.8rem;
  max-width: 6.8rem;
}

.catalog-table th:nth-child(13),
.catalog-table td:nth-child(13) {
  width: 8.5%;
  min-width: 8.5rem;
  max-width: 8.5rem;
}

.catalog-table th:nth-child(11),
.catalog-table th:nth-child(12),
.catalog-table th:nth-child(13) {
  white-space: nowrap;
}

.catalog-table thead tr:first-child th.dcp-col {
  border-bottom: 0;
}

.catalog-table thead th[rowspan] {
  vertical-align: bottom;
  padding-bottom: 0.7rem;
}

.panel-meta-text {
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.panel-meta-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-meta-key {
  font-weight: 600;
  white-space: nowrap;
}

.panel-meta-value {
  font-weight: 500;
}

.panel-sw-input {
  max-width: 120px;
  width: 120px;
  height: 2rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 400;
}

.panel-history-btn {
  width: 2rem;
  height: 2rem;
}

.panel-history-modal {
  width: min(1800px, 99vw) !important;
  max-width: 99vw;
  max-height: 88vh;
  overflow: auto;
}

.panel-history-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(460px, 2.6fr) minmax(210px, 1fr) auto auto;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 0.8rem;
}

.panel-history-form .modal-field {
  margin-bottom: 0;
}

.panel-history-form .modal-field:nth-child(2) textarea {
  min-width: 440px;
}

.panel-history-form .modal-field:nth-child(2) {
  align-self: start;
}

.panel-history-form .modal-field input {
  height: 2.15rem;
}

.panel-history-form .modal-field textarea {
  min-height: 2.15rem;
}

.panel-history-actions {
  display: flex;
  align-items: flex-end;
  align-self: end;
  padding-bottom: 0;
}

.panel-history-release-toggle {
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

#panelHistoryAddBtn {
  width: 2.15rem;
  height: 2.15rem;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.panel-history-table-wrap {
  overflow-x: auto;
}

.panel-history-table {
  min-width: 720px;
}

.panel-history-table th,
.panel-history-table td {
  font-size: 0.84rem;
}

.history-action-cell {
  text-align: right;
  width: 2.4rem;
}

.release-pill {
  display: inline-block;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.release-pill-released {
  background: #ecfdf3;
  border-color: #a6f4c5;
  color: #067647;
}

.release-pill-not-released {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
  vertical-align: middle;
}

.panel-version-table thead tr:first-child th:not([rowspan]) {
  border-bottom: 0;
}

.panel-version-table thead th[rowspan] {
  vertical-align: bottom;
  padding-bottom: 0.7rem;
}

.panel-version-table th:nth-child(4),
.panel-version-table td:nth-child(4) {
  width: var(--panel-device-col-width, 20ch);
}

.panel-version-table th:nth-child(2),
.panel-version-table td:nth-child(2) {
  width: var(--panel-type-col-width, 12ch);
}

.panel-version-table th:nth-child(3),
.panel-version-table td:nth-child(3) {
  width: var(--panel-manufacturer-col-width, 16ch);
}

.panel-version-table th:first-child,
.panel-version-table td:first-child {
  width: 2rem;
}

.panel-flag-cell {
  text-align: center;
}

.panel-flag-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #facc15;
}

.panel-version-table .type-separator-row td {
  padding: 0;
  height: 8px;
  border-bottom: 0;
  border-top: 2px solid var(--border);
  background: #fff;
}

input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  width: 100%;
  font-family: inherit;
}

textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  width: 100%;
  font-family: inherit;
  resize: vertical;
  margin: 0;
  display: block;
  box-sizing: border-box;
}

.compact-input {
  width: 100%;
  min-width: 56px;
}

.device-fid-stack,
.device-cf-stack,
.device-if-stack,
.device-nad-stack,
.device-sid-stack,
.device-vid-stack {
  display: grid;
  gap: 0.22rem;
}

.split-id-entry {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  position: relative;
}

.split-id-entry.is-collapsed-extra {
  display: none;
}

.split-id-toggle {
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.split-id-entry:first-child .split-id-toggle {
  display: inline-flex;
}

.split-id-toggle-chevron {
  font-size: 0.7rem;
  line-height: 1;
}

.split-id-input {
  min-height: 1.9rem;
}

.split-id-entry:first-child .split-id-input {
  padding-right: 1.4rem;
}

.compact-input.id-empty {
  border-color: #f1b3ae;
  background: #fffafa;
}

.catalog-table td.id-row-incomplete {
  position: relative;
  overflow: visible;
}

.catalog-table td.id-row-incomplete::before {
  content: "";
  position: absolute;
  left: -0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #ef4444;
}

.history-change-lines {
  display: grid;
  gap: 0.1rem;
}

select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  width: 100%;
  background: #fff;
}

.status-integrated {
  background: #ecfdf3;
  border-color: #a6f4c5;
  color: #067647;
}

.status-in-development {
  background: #fffaeb;
  border-color: #fedf89;
  color: #b54708;
}

.status-not-integrated {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.status-pill {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-weight: 600;
}

.pdf-popover {
  position: fixed;
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
  z-index: 60;
}

.pdf-popover-btn {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.pdf-popover-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

.pdf-popover-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.pdf-text-icon {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.open-device-pdf-btn.pdf-missing {
  border-color: #f1b3ae;
  background: #fffafa;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-strong);
}

#addDeviceBtn,
#addConfigBtn,
.add-config-device-btn {
  background: #e8efff;
  color: #2045cc;
  border: 1px solid #c7d7ff;
}

#addDeviceBtn:hover,
#addConfigBtn:hover,
.add-config-device-btn:hover {
  background: #dce7ff;
}

.secondary {
  background: var(--secondary);
  color: var(--primary-strong);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.danger {
  color: var(--danger);
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.icon-btn:hover {
  background: #fff2f1;
}

.icon-btn:focus-visible {
  outline: 2px solid #fda29b;
  outline-offset: 1px;
}

.overview {
  padding: 1rem;
}

.list-wrap {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.config-group-title {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  width: min(460px, 95vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.stats-modal {
  width: min(1380px, 98vw);
  max-height: 92vh;
  overflow: auto;
  padding: 1.4rem;
}

#searchModal {
  width: min(1100px, 97vw);
  max-height: 92vh;
  overflow: auto;
}

.device-list-modal {
  width: min(1100px, 97vw);
  max-height: 92vh;
  overflow: auto;
}

.device-list-table-wrap {
  overflow-x: auto;
}

.device-list-table {
  min-width: 720px;
}

.device-list-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.device-list-export-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.device-list-export-lang select {
  width: auto;
  min-width: 7.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.stats-header h3 {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  align-items: start;
  gap: 1.35rem;
}

.stats-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  overflow: visible;
}

.stats-grid > .stats-card:nth-child(-n + 3):not(.stats-card-wide) {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stats-grid > .stats-card:nth-child(-n + 3):not(.stats-card-wide) > h4 {
  margin-bottom: 0.8rem;
  align-self: flex-start;
}

.stats-grid > .stats-card:nth-child(-n + 3):not(.stats-card-wide) > :not(h4) {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.stats-grid > .stats-card:nth-child(-n + 3):not(.stats-card-wide) > :nth-child(2) {
  margin-top: 0;
}

.stats-grid > .stats-card:nth-child(-n + 3):not(.stats-card-wide) > :last-child {
  margin-bottom: 0;
}

.search-result-wrap {
  margin-top: 0.8rem;
}

.search-suggestions {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  max-height: 220px;
  overflow: auto;
  margin-top: -0.2rem;
}

.search-suggestion-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef1f8;
  background: transparent;
  padding: 0.5rem 0.65rem;
  font-size: 0.87rem;
  font-weight: 400;
}

.search-suggestion-item:last-child {
  border-bottom: 0;
}

.search-match {
  font-weight: 700;
}

.search-result-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #f9fbff;
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.search-result-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stats-card-wide {
  grid-column: 1 / -1;
}

@media (max-width: 680px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .panel-history-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.stats-card h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.stats-main-number {
  font-size: 1.6rem;
  font-weight: 700;
}

.stats-subline {
  color: var(--muted);
  font-size: 0.88rem;
}

.donut-wrap {
  width: 220px;
  height: 220px;
  margin: 0;
}

.stats-legend {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  justify-items: start;
  min-width: 0;
}

.stats-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.86rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.donut-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  width: 100%;
}

.bar-chart-wrap {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(180px, 1fr) 36px;
  align-items: center;
  gap: 0.45rem;
}

.bar-label {
  font-size: 0.86rem;
  color: var(--muted);
}

.bar-track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: #edf1fb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-fill-westfalia {
  background: #2f5dff;
}

.bar-fill-knaus {
  background: #10b981;
}

.bar-value {
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
}

.potential-report-card {
  display: grid;
  gap: 0.7rem;
}

.potential-summary {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

.potential-chart-wrap {
  display: grid;
  gap: 0.55rem;
}

.potential-oem-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.oem-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #dbe3f7;
  background: #f7f9ff;
  font-size: 0.76rem;
  color: #4a5568;
}

.potential-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(140px, 1fr) 40px;
  gap: 0.45rem;
  align-items: center;
}

.potential-type {
  font-size: 0.85rem;
  color: var(--muted);
}

.potential-track {
  width: 100%;
  height: 0.62rem;
  border-radius: 999px;
  background: #eef2ff;
  overflow: hidden;
}

.potential-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.potential-value {
  font-weight: 700;
  text-align: right;
}

.potential-meta {
  grid-column: 1 / -1;
  font-size: 0.76rem;
  color: #7a8194;
}

.potential-list-wrap {
  overflow-x: auto;
}

.potential-table {
  min-width: 680px;
}

.potential-table th,
.potential-table td {
  font-size: 0.82rem;
}

.sales-report-card .sales-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.sales-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.sales-summary-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  min-height: 78px;
  display: grid;
  align-content: center;
}

.sales-kpi {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sales-label {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.sales-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.sales-top-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}

.sales-top-card h5 {
  margin: 0 0 0.45rem 0;
  font-size: 0.9rem;
}

.sales-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.18rem 0;
  border-bottom: 1px dashed rgba(16, 24, 40, 0.08);
  font-size: 0.86rem;
}

.sales-top-row:last-child {
  border-bottom: 0;
}

.sales-top-row strong {
  font-weight: 800;
}

.sales-muted {
  color: var(--muted);
  font-size: 0.82em;
}

.sales-hint {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .sales-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sales-top-grid {
    grid-template-columns: 1fr;
  }
}

.candidate-pill {
  display: inline-block;
  margin: 0.1rem 0.2rem 0.1rem 0;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  white-space: nowrap;
}


.modal h3 {
  margin: 0 0 0.9rem;
}

.modal-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}

.modal-subline {
  color: var(--muted);
  font-size: 0.84rem;
}

.modal-checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
}

.modal-checkbox-field input {
  width: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.assignment-action-cell {
  text-align: right;
  white-space: nowrap;
}

.catalog-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.assignment-action-cell .add-config-device-btn {
  margin-right: 0.35rem;
}

.config-assignment-cell {
  text-align: center;
  font-weight: 700;
}

.assignment-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.assignment-dot-btn {
  border: 0;
  background: transparent;
  padding: 0;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.assignment-cell-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.assignment-remove-btn {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.72rem;
  line-height: 1;
  width: 0.8rem;
  height: 0.8rem;
  padding: 0;
  cursor: pointer;
}

.assignment-dot-serial {
  background: #22c55e;
}

.assignment-dot-optional {
  background: #facc15;
}

.assignment-dot-delete {
  background: #ef4444;
}

.configuration-matrix-table .assignment-action-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
}

.configuration-matrix-table .assignment-action-cell .add-config-device-btn {
  margin-right: 0;
}

.configuration-matrix-table thead tr:first-child th:nth-child(n + 4) {
  text-align: center;
}

.configuration-matrix-table thead tr:first-child th:nth-child(n + 4) {
  border-right: 2px solid var(--border);
}

.configuration-matrix-table thead tr:first-child th:last-child {
  border-right: 0;
}

.configuration-matrix-table thead tr:nth-child(2) th {
  font-weight: 400;
  text-align: center;
}

.config-device-header {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
}

.config-device-name {
  font-weight: 400;
}

.config-device-manufacturer {
  font-size: 0.68rem;
  color: #98a2b3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.configuration-matrix-table .type-group-end {
  border-right: 2px solid var(--border);
}

.configuration-matrix-table th,
.configuration-matrix-table td {
  font-size: 0.85rem;
}

.configuration-matrix-table thead tr:first-child th:nth-child(3),
.configuration-matrix-table tbody td:nth-child(3) {
  border-right: 2px solid var(--border);
}

/* Row 2 only contains device columns (first three cells are rowspanned), so use index from 1 — not n+4 */
.configuration-matrix-table thead tr:nth-child(2) th:not(.type-group-end):not(:last-child),
.configuration-matrix-table tbody td.config-assignment-cell:nth-child(n + 4):not(.type-group-end):not(:last-child) {
  border-right: 1px solid #e8ecf5;
}

.configuration-matrix-table thead tr:nth-child(2) th.type-group-end:last-child,
.configuration-matrix-table tbody td.type-group-end:last-child {
  border-right: 1px solid var(--border);
}
