.client-specs-panel {
  grid-column: 1 / -1;
}

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

.client-specs-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#clientSpecsSelect {
  min-width: 280px;
  min-height: 32px;
  font-size: 12px;
}

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

.client-specs-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
}

.client-specs-preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

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

.client-specs-preview-table th:last-child,
.client-specs-preview-table td:last-child {
  border-right: none;
}

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

.client-specs-editor-card {
  width: min(1320px, 98vw);
}

.client-specs-manage-card {
  width: min(980px, 96vw);
}

.client-specs-manage-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#clientSpecsManageSearch {
  min-width: 220px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 12px;
}

.client-specs-manage-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.client-specs-manage-head,
.client-specs-manage-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px) 120px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.client-specs-manage-head {
  background: #eef3fb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3f4d64;
  border-bottom: 1px solid var(--border);
}

.client-specs-manage-list {
  max-height: min(60vh, 520px);
  overflow: auto;
}

.client-specs-manage-row {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.client-specs-manage-row:last-child {
  border-bottom: none;
}

.client-db-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-db-name .client-db-tag {
  font-size: 10px;
  color: var(--muted);
}

.client-db-country {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-db-flag {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.client-db-country input {
  width: 100%;
  min-width: 160px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px 8px;
}

.client-db-delete {
  justify-self: flex-start;
}

.client-specs-tags-card {
  width: min(760px, 96vw);
}

.client-specs-tags-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}

.client-specs-tags-head,
.client-specs-tags-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 100px 120px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

.client-specs-tags-head {
  background: #eef3fb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3f4d64;
  border-bottom: 1px solid var(--border);
}

.client-specs-tags-list {
  max-height: min(52vh, 420px);
  overflow: auto;
}

.client-specs-tags-row {
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.client-specs-tags-row:last-child {
  border-bottom: none;
}

.client-specs-tags-count {
  color: var(--muted);
  font-size: 11px;
}

body.theme-dark .client-specs-manage-head {
  background: #1e2a3a;
  color: #bfd1eb;
}

body.theme-dark .client-specs-tags-head {
  background: #1e2a3a;
  color: #bfd1eb;
}

body.theme-dark .client-db-flag {
  background: #151a22;
  border-color: #2a3342;
}

.client-specs-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-specs-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: min(76vh, 720px);
  background: var(--card);
}

.client-specs-editor-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1120px;
}

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

.client-specs-editor-table th:last-child,
.client-specs-editor-table td:last-child {
  border-right: none;
}

.client-specs-editor-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef3fb;
}

.client-specs-editor-table .col-select {
  width: 94px;
}

.client-specs-editor-table .col-voce {
  width: 260px;
}

.client-specs-editor-table .col-valore {
  width: 300px;
}

.client-specs-editor-table .col-note {
  width: 340px;
}

.client-specs-editor-table .col-tag {
  width: 260px;
}

.client-specs-editor-table input[type="text"],
.client-specs-editor-table textarea {
  width: 100%;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px 8px;
}

.client-specs-editor-table textarea {
  min-height: 60px;
  resize: vertical;
}

.client-specs-editor-table tr.row-invalid td {
  background: #fff1f1;
}

.client-specs-row-order {
  color: var(--muted);
  font-size: 11px;
}

.client-specs-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 4px 2px 0;
}

.client-specs-tag-pill .tag-remove {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.client-specs-tag-editor {
  display: grid;
  gap: 6px;
}

.client-specs-tag-editor input[type="text"].client-specs-tag-input {
  width: 100%;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 6px 8px;
}

.client-specs-row-move-tools {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.client-specs-row-move-btn {
  min-width: 24px;
  height: 24px;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.theme-dark .client-specs-preview-table thead th,
body.theme-dark .client-specs-editor-table thead th {
  background: #1e2a3a;
  color: #bfd1eb;
}

body.theme-dark .client-specs-editor-table tr.row-invalid td {
  background: #321f24;
}
