.measurement-system-specs {
  padding: 12px;
}

.create-table-form {
  margin: 20px 0;
  padding: 15px;
  background: #fff;
  border: 1px solid #ccd0d4;
}

.create-table-inputs {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-weight: 600;
}

.form-field input {
  width: 150px;
}

.form-field input[type="number"] {
  width: 80px;
}

/* Tabellen Styling */
.spec-table {
  margin: 20px 0;
  background: #fff;
  border: 1px solid #ccd0d4;
}

.spec-table-header {
  padding: 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #ccd0d4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spec-table-header input.table-title {
  width: 300px;
}

.spec-table-content {
  padding: 10px;
}

.spec-table-content table {
  border-collapse: collapse;
  width: 100%;
}

.spec-table-content td {
  padding: 5px;
  border: 1px solid #ccd0d4;
}

.spec-table-content input {
  width: 100%;
  border: 1px solid #ddd;
  padding: 4px 8px;
}

.spec-table-content input:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: 2px solid transparent;
}

/* Zellenauswahl Styles */
.cell-selection-active td {
  cursor: pointer;
}

.cell-selection-active td:hover {
  background-color: rgba(0, 120, 255, 0.1);
}

.cell-selection-active td.selected {
  background-color: rgba(0, 120, 255, 0.2);
}

/* Verbundene Zellen Styles */
.spec-table td[rowspan],
.spec-table td[colspan] {
  background-color: #f8f9fa;
}

/* Zellen-Styling */
.spec-cell {
  position: relative;
}

.cell-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cell-content input[type="text"] {
  width: 100%;
}

/* Menü-Button Styling */
.cell-menu-button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.cell-content:hover .cell-menu-button {
  opacity: 1;
}

.cell-menu-button .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* Zellen-Styling */
.spec-cell {
  position: relative !important;
  padding: 8px !important;
}

.cell-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cell-content input[type="text"] {
  width: calc(100% - 30px) !important;
}

/* Menu Button */
.cell-menu-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border: 1px solid #ddd !important;
  background: #f5f5f5 !important;
  cursor: pointer !important;
  border-radius: 3px !important;
}

.cell-menu-button:hover {
  background: #e5e5e5 !important;
  border-color: #999 !important;
}

.cell-menu-button .dashicons {
  width: 16px !important;
  height: 16px !important;
  font-size: 16px !important;
  display: block !important;
}

/* Menu */
.cell-menu {
  display: none;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: white !important;
  border: 1px solid #ccd0d4 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  padding: 10px !important;
  z-index: 1000 !important;
  min-width: 200px !important;
  margin-top: 5px !important;
}

.cell-menu.active {
  display: block !important;
}

.rowspan-control {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.rowspan-control label {
  font-weight: 600 !important;
}

.rowspan-control input[type="number"] {
  width: 80px !important;
  padding: 4px 8px !important;
}

.rowspan-control .button {
  margin-top: 5px !important;
}

/* Wichtige Positionierung */
td.spec-cell {
  position: relative !important;
}

.spec-table td {
  vertical-align: top !important;
}

/* Rowspan Styling */
td[rowspan] {
  background-color: #f8f9fa !important;
}

.header-row-control {
  display: flex;
  align-items: center;
  margin: 0 var(--spacing-3);
}

.header-row-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.header-row-checkbox {
  margin: 0;
}

.spec-table-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-3);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.spec-table-footnotes {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.footnotes-list {
  margin-bottom: 15px;
}

.footnote-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footnote-number {
  font-weight: 600;
  min-width: 20px;
}

.footnote-item input {
  flex: 1;
}

.remove-footnote {
  padding: 0 6px !important;
  min-height: 0 !important;
}

/* Fußnoten Dropdown Styling */
.footnote-control {
  margin-top: 10px;
}

.footnote-control label {
  display: block;
  margin-bottom: 5px;
}

.footnote-select {
  width: 100%;
  max-width: 100%;
}

/* Aktive Fußnote hervorheben */
.footnote-select option[selected] {
  background-color: var(--wp-admin-theme-color);
  color: white;
}
