.thermo-panel {
  grid-column: 1 / -1;
}

.thermo-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.thermo-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thermo-filters select,
.thermo-filters input {
  min-height: 30px;
  font-size: 12px;
}

.thermo-filters #thermoSearchInput {
  min-width: 220px;
}

.thermo-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: calc(100vh - 210px);
  background: var(--card);
}

.thermo-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1500px;
}

.thermo-table th,
.thermo-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  font-size: 12px;
}

.thermo-table th:last-child,
.thermo-table td:last-child {
  border-right: none;
}

.thermo-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef3fb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3f4d64;
}

.thermo-table tbody tr:nth-child(even) {
  background: #fafcff;
}

.thermo-commessa-cell {
  min-width: 220px;
}

.thermo-commessa-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.thermo-commessa-num {
  font-weight: 700;
}

.thermo-commessa-code {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11px;
}

.thermo-commessa-desc {
  color: var(--muted);
  line-height: 1.25;
}

.thermo-cell-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  background: #f7f9fc;
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
}

.thermo-cell-btn:hover {
  background: #eaf1ff;
}

.thermo-cell-sub {
  font-size: 10px;
  color: var(--muted);
}

.thermo-cell-inline {
  display: grid;
  gap: 3px;
}

.thermo-select {
  min-width: 120px;
  min-height: 28px;
  font-size: 11px;
  padding: 3px 6px;
}

.thermo-note {
  width: 240px;
  min-height: 60px;
  resize: vertical;
  font-size: 12px;
}

.thermo-yes {
  color: #1f5c35;
  font-weight: 700;
}

.thermo-no {
  color: #8a2d2d;
  font-weight: 700;
}

.thermo-editor-card {
  width: min(620px, 96vw);
}

.thermo-import-card {
  width: min(1100px, 96vw);
}

.thermo-import-body {
  display: grid;
  gap: 10px;
}

.thermo-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thermo-import-header {
  font-size: 11px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8faff;
  padding: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

#thermoImportTextarea {
  width: 100%;
  min-height: 180px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.thermo-import-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 320px;
  overflow: auto;
  background: var(--card);
}

.thermo-import-preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.thermo-import-preview-table th,
.thermo-import-preview-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  vertical-align: top;
  text-align: left;
}

.thermo-import-preview-table thead th {
  position: sticky;
  top: 0;
  background: #eef3fb;
  z-index: 1;
}

.thermo-import-preview-row-ok {
  background: #effaf2;
}

.thermo-import-preview-row-error {
  background: #fff1f1;
}

.thermo-import-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.thermo-import-badge-ok {
  color: #1f5c35;
  background: #e8f7ee;
  border-color: #b8e3c9;
}

.thermo-import-badge-error {
  color: #8a2d2d;
  background: #ffe7e7;
  border-color: #f2b8b8;
}

.thermo-editor-body {
  display: grid;
  gap: 10px;
}

.thermo-editor-grid {
  display: grid;
  gap: 10px;
}

.thermo-editor-cluster {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #f9fbff;
}

.thermo-editor-cluster-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.thermo-radio-list {
  display: grid;
  gap: 6px;
}

.thermo-radio-list label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.thermo-editor-field {
  display: grid;
  gap: 4px;
}

.thermo-editor-field label {
  font-size: 12px;
  color: var(--muted);
}

.thermo-editor-field input,
.thermo-editor-field select {
  min-height: 30px;
  font-size: 12px;
}

.thermo-order-special {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

body.theme-dark .thermo-table thead th {
  background: #1e2a3a;
  color: #bfd1eb;
}

body.theme-dark .thermo-table tbody tr:nth-child(even) {
  background: #171f2c;
}

body.theme-dark .thermo-cell-btn {
  background: #1a2332;
  border-color: #33445f;
  color: #e2ebf7;
}

body.theme-dark .thermo-cell-btn:hover {
  background: #223148;
}

body.theme-dark .thermo-editor-cluster {
  background: #1a2331;
  border-color: #33445f;
}

body.theme-dark .thermo-editor-cluster-title {
  color: #d5e2f4;
}

body.theme-dark .thermo-import-header {
  background: #1a2331;
  border-color: #33445f;
}

body.theme-dark .thermo-import-preview-table thead th {
  background: #1e2a3a;
}

body.theme-dark .thermo-import-preview-row-ok {
  background: #1b2a22;
}

body.theme-dark .thermo-import-preview-row-error {
  background: #321f24;
}
