/* ===================
   dictation_editor_modal.css
   Редактор диктантов в модальном окне
   =================== */

/* ===== ОСНОВНАЯ МОДАЛКА ===== */
#dictationEditorModal.dictation-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 100249;
  display: none;
  background: rgba(17, 24, 39, 0.38);
  backdrop-filter: blur(1px);
}

.dictation-editor-modal__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-panel-bg, #f5f3f0);
  overflow: hidden;
}

/* ===== HEADER ===== */
.dictation-editor-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-hover, #f8f9fa);
  border-bottom: 1px solid var(--color-border-light, #e9ecef);
  flex-shrink: 0;
}

.dictation-editor-modal__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dictation-editor-modal__logo {
  height: 5em;
  width: auto;
  max-height: 80px;
  cursor: pointer;
}

.dictation-editor-modal__logo--min {
  display: none;
}

.dictation-editor-modal__cover-wrapper {
  width: 60px;
  height: 36px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-hover, #e8e6e3);
  flex-shrink: 0;
}

.dictation-editor-modal__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dictation-editor-modal__header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dictation-editor-modal__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dictation-editor-modal__username {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #1f2933);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28vw;
}

.dictation-editor-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

#dictationEditorModalSaveBtn {
  margin: 0 12px;
}

/* ===== ЗВЁЗДЫ НЕСОХРАНЁННЫХ ИЗМЕНЕНИЙ ===== */
.dictation-editor-modal__header-container .unsaved-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  margin-left: 4px;
  border-radius: 50%;
  font-weight: bold;
}

/* ===== BODY ===== */
.dictation-editor-modal__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 5vw 16px;
}

/* ===== HEADER CONTAINER (флаги + badge + название + id) ===== */
.dictation-editor-modal__header-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Режим редактора: Начальное заполнение / Дополнение */
.dictation-editor-modal__mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.dictation-editor-modal__mode-badge[data-mode="append"] {
  background: #f5f5f5;
  color: #757575;
  border-color: #e0e0e0;
}

.dictation-editor-modal__lang-pair {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Дропдаун для выбора языка перевода в редакторе — правый флаг */
/* left вычисляется динамически через JS в _initLanguageFlags() */
.dictation-editor-modal__lang-pair .flag-pair-dropdown[data-side="right"] {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: auto;
  z-index: 1100;
}

.dictation-editor-modal__lang-pair .flag-pair-combo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dictation-editor-modal__lang-pair .language-flag {
  width: 30px;
  height: 20px;
  margin-right: 5px;
  margin-left: 5px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid var(--color-flag-border, rgba(0,0,0,0.1));
}

.dictation-editor-modal__lang-pair .flag-pair-combo i[data-lucide] {
  width: 18px;
  height: 18px;
}

.dictation-editor-modal__header-container h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text, #224156);
  flex: 1;
}

.dictation-editor-modal__id {
  font-size: 13px;
  color: var(--color-button-text-transparent, #888);
  font-family: monospace;
  margin-left: auto;
  flex-shrink: 0;
}

/* ===== PANEL С ЗАКЛАДКАМИ ===== */
.dictation-editor-modal__tabs-panel {
  background: var(--color-panel-bg);
  border-radius: 8px;
  margin-bottom: 12px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dictation-editor-modal__tabs-header {
  display: flex;
  gap: 0;
  padding: 8px 8px 0 0;
  background: var(--color-panel-bg);
}

.dictation-editor-modal__tab-btn {
  padding: 9px 20px;
  background: var(--color-hover);
  border: 1px solid var(--color-border-light);
  color: var(--color-button-text-transparent);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
  border-bottom: 2px solid transparent;
  margin-right: 4px;
  flex-shrink: 0;
}

.dictation-editor-modal__tab-btn:hover {
  color: var(--color-button-text-transparent);
  background: var(--color-hover);
  border: 1px solid var(--color-border-light);
  border-bottom: 2px solid transparent;
}

.dictation-editor-modal__tab-btn.active {
  color: var(--color-button-text-transparent);
  background: var(--color-panel-bg);
  border-bottom: 2px solid var(--color-panel-bg);
  margin-bottom: -1px;
  z-index: 2;
}

.dictation-editor-modal__tabs-body {
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 0 8px 8px 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dictation-editor-modal__tab-content {
  display: none;
  padding: 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dictation-editor-modal__tab-content.active {
  display: flex;
  flex-direction: column;
}

/* ===== ВКЛАДКА "ОБЩИЕ ДАННЫЕ" ===== */
.dictation-editor-modal__editor-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.dictation-editor-modal__editor-header-panel-1 {
  flex-shrink: 0;
  min-width: 160px;
}

.dictation-editor-modal__editor-header-panel-2 {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cover */
.dictation-editor-modal__cover-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.dictation-editor-modal__cover-display {
  width: 200px;
  height: 120px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-hover);
}

.dictation-editor-modal__cover-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dictation-editor-modal__cover-upload {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dictation-editor-modal__cover-upload .button-color-yellow {
  height: 38px;
  width: 200px;
  border-radius: 0 0 8px 8px;
  align-items: center;
  justify-content: center;
}

/* Form groups */
.dictation-editor-modal__form-group-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Строка "Посилання на матеріали автора" — label сверху, input на всю ширину */
.dictation-editor-modal__form-group-line--author-url {
  flex-direction: column;
  align-items: stretch;
}
.dictation-editor-modal__form-group-line--author-url label {
  white-space: normal;
}
.dictation-editor-modal__form-group-line--author-url .text-input {
  width: 100%;
  box-sizing: border-box;
}

.dictation-editor-modal__form-group-line label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text, #224156);
}

.dictation-editor-modal__form-group-line .text-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  background: var(--color-panel-bg);
  color: var(--color-text, #224156);
}

/* Title + level row */
.dictation-editor-modal__title-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dictation-editor-modal__title-level-row .text-input {
  flex: 1;
  min-width: 0;
}

/* Level selector */
.dictation-editor-modal__form-group-line .custom-speed-select {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-select-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 6px;
  background: var(--color-panel-bg);
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text, #224156);
  min-width: 80px;
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-select-button:hover {
  border-color: var(--color-button-text-yellow, #f9c609);
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 100%;
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
}

.dictation-editor-modal__form-group-line .custom-speed-select.open .speed-options {
  display: block;
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-options li {
  padding: 6px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text, #224156);
  white-space: nowrap;
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-options li:hover {
  background: var(--color-hover);
}

.dictation-editor-modal__form-group-line .custom-speed-select .speed-options li.selected {
  background: var(--color-button-text-yellow, #f9c609);
  color: #fff;
}

/* ===== РАДИО-КНОПКИ (Voice Mode) ===== */
.dictation-editor-modal__voice-mode-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border-light, #eee);
}

.dictation-editor-modal__voice-mode-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text, #224156);
  padding-top: 0;
}

.dictation-editor-modal__voice-mode-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dictation-editor-modal__voice-mode-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text, #224156);
}

.dictation-editor-modal__voice-mode-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border-light, #bbb);
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.dictation-editor-modal__voice-mode-radio input[type="radio"]:checked {
  border-color: var(--color-button-text-yellow, #f9c609);
}

.dictation-editor-modal__voice-mode-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--color-button-text-yellow, #f9c609);
  border-radius: 50%;
}

.dictation-editor-modal__voice-mode-radio input[type="radio"]:hover {
  border-color: var(--color-button-text-yellow, #f9c609);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .dictation-editor-modal__tabs-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dictation-editor-modal__tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .dictation-editor-modal__tab-content {
    padding: 15px;
  }

  .dictation-editor-modal__editor-header {
    flex-direction: column;
  }

  .dictation-editor-modal__editor-header-panel-1 {
    align-self: flex-start;
  }
}

/* ===== ВКЛАДКА "АВТОЗАПОВНЕННЯ ОРИГІНАЛУ" (voice-original-auto) ===== */
.dictation-editor-modal__auto-audio-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100px;
}

/* Панель с текущей строкой и кнопкой — без обводки */
.dictation-editor-modal__auto-audio-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.dictation-editor-modal__auto-audio-text {
  font-size: 14px;
  color: var(--color-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.dictation-editor-modal__auto-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--color-button-yellow);
  color: var(--color-button-text-yellow);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s;
}

.dictation-editor-modal__auto-generate-btn:hover {
  opacity: 0.85;
}

.dictation-editor-modal__auto-generate-btn i {
  width: 22px;
  height: 22px;
}

/* Футер с кнопкой "Перезаполнить все" */
.dictation-editor-modal__auto-audio-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.dictation-editor-modal__auto-regenerate-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--color-button-yellow);
  color: var(--color-button-text-yellow);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, opacity 0.15s;
}

.dictation-editor-modal__auto-regenerate-all-btn:hover {
  opacity: 0.85;
}

.dictation-editor-modal__auto-regenerate-all-btn i {
  width: 18px;
  height: 18px;
}

/* ===== ВКЛАДКА "Є АУДІО" (voice-original-have) ===== */
.dictation-editor-modal__have-audio-content {
  padding: 16px;
}

/* Панели над волной: контейнер (flex, без обводок) */
.dictation-editor-modal__waveform-info-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

/* Левая панель: название файла + текст оригинала */
.dictation-editor-modal__file-selection {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  color: var(--color-text, #224156);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.dictation-editor-modal__waveform-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text, #224156);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dictation-editor-modal__waveform-sentence-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-secondary, #5a6b7a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Правая панель: кнопка выбора файла */
.dictation-editor-modal__waveform-info-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.dictation-editor-modal__file-select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-button-purple);
  color: var(--color-button-text-purple);
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent;
  transition: all 0.2s ease;
  position: relative;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 6px;
}

.dictation-editor-modal__file-select-btn:hover {
  border: 1px solid var(--color-button-shadow-purple);
  box-shadow: 0 3px 0 0 var(--color-button-shadow-purple);
}

.dictation-editor-modal__file-select-btn:focus {
  outline: 2px solid var(--color-button-text-purple);
  outline-offset: 2px;
}

.dictation-editor-modal__file-select-btn:active {
  border: 1px solid var(--color-button-shadow-purple);
}

.dictation-editor-modal__waveform-section {
  margin-bottom: 12px;
}

.dictation-editor-modal__waveform-container {
  width: 100%;
  height: 100px;
  min-height: 100px;
  background: var(--color-hover, #f0eeeb);
  border-radius: 8px;
  overflow: hidden;
}

.dictation-editor-modal__have-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dictation-editor-modal__time-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text, #224156);
}

/* Группа полей Start/End под волной — внешняя панель */
.time-input-group {
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  background: var(--color-panel-bg, #fff);
  border: 1px solid var(--color-border-light, #ddd);
}

.time-input-field {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-panel-bg, #fff);
  overflow: visible;
  height: 44px;
  box-shadow: none;
}

.time-input-field input[type="number"] {
  width: 70px;
  padding: 0 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: var(--color-text, #224156);
  text-align: center;
  appearance: textfield;
  height: 44px;
  line-height: 44px;
}

.time-input-field input[type="number"]::-webkit-inner-spin-button,
.time-input-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-input-field input[type="number"]:focus {
  outline: none;
}

/* Контейнер для стрелок — колонка */
.time-input-field .time-input-arrows {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 44px;
  flex-shrink: 0;
}

.time-input-field .time-input-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-button-text-transparent, #888);
  padding: 0;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
}

.time-input-field .time-input-arrow:hover {
  color: var(--color-button-text-yellow, #f9c609);
  background: var(--color-hover, #f0eeeb);
}

.time-input-field .time-input-arrow i {
  width: 12px;
  height: 12px;
}

/* Start: правые углы прямые, разделитель справа */
.time-input-field--start {
  border-right: 1px solid var(--color-border-light, #ddd);
}



.dictation-editor-modal__wave-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  height: 44px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 8px;
  background: var(--color-panel-bg, #fff);
  color: var(--color-text, #224156);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dictation-editor-modal__wave-btn:hover {
  background: var(--color-hover, #f0eeeb);
  border-color: var(--color-border, #ccc);
}

.dictation-editor-modal__wave-btn i {
  width: 16px;
  height: 16px;
}

.dictation-editor-modal__wave-btn--yellow {
  background: var(--color-button-yellow, #f9c609);
  color: var(--color-button-text-yellow, #fff);
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent;
  transition: all 0.2s ease;
}

.dictation-editor-modal__wave-btn--yellow:focus {
  outline: 2px solid var(--color-button-text-yellow);
  outline-offset: 2px;
}

.dictation-editor-modal__wave-btn--yellow:hover {
  border: 1px solid var(--color-button-shadow-yellow);
  box-shadow: 0 3px 0 0 var(--color-button-shadow-yellow);
}

.dictation-editor-modal__wave-btn--yellow:active {
  border: 1px solid var(--color-button-shadow-yellow);
}

/* ===== ТАБЛИЦА ПРЕДЛОЖЕНИЙ ===== */
.dictation-editor-modal__table-section {
  margin-top: 12px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dictation-editor-modal__table-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.dictation-editor-modal__table-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 8px;
  background: var(--color-panel-bg, #fff);
  color: var(--color-text, #224156);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dictation-editor-modal__table-control-btn:hover {
  background: var(--color-hover, #f0eeeb);
  border-color: var(--color-border, #ccc);
}

.dictation-editor-modal__table-control-btn i {
  width: 16px;
  height: 16px;
}

.dictation-editor-modal__table-control-btn.delete-btn:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

.dictation-editor-modal__table-control-btn.add-btn:hover {
  color: #27ae60;
  border-color: #27ae60;
}

.dictation-editor-modal__table-nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.dictation-editor-modal__table-nav-group .dictation-editor-modal__table-control-btn {
  opacity: 0.4;
}

.dictation-editor-modal__current-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #224156);
  background: transparent;
  border-radius: 6px;
}

.dictation-editor-modal__current-row-label span {
  outline: none;
  text-align: center;
  min-width: 20px;
}

.dictation-editor-modal__sentences-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--color-border-light, #e5e3df);
  border-radius: 8px;
  background: var(--color-panel-bg, #fff);
  flex: 1;
  min-height: 0;
}

/* ===== СТИЛИ ТАБЛИЦЫ ===== */
.dictation-editor-modal__sentences-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

.dictation-editor-modal__sentences-table th,
.dictation-editor-modal__sentences-table td {
  display: none;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-light, #e5e3df);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.dictation-editor-modal__sentences-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-hover-panel, #f7f6f5);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-button-text-transparent, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  border-bottom: 2px solid var(--color-border-light, #e5e3df);
}

/* Все колонки скрыты по умолчанию (управляется через JS) */
.dictation-editor-modal__sentences-table th,
.dictation-editor-modal__sentences-table td {
  display: none;
}

/* Базовые колонки, видимые всегда */
.dictation-editor-modal__sentences-table .col-number,
.dictation-editor-modal__sentences-table .col-scrolling {
  display: table-cell !important;
}

/* Номер колонки */
.dictation-editor-modal__sentences-table .col-number {
  width: 40px;
  text-align: center;
  color: var(--color-button-text-transparent, #888);
  font-weight: 500;
}

/* Колонка прокрутки */
.dictation-editor-modal__sentences-table .col-scrolling {
  width: 1px;
  padding: 0;
}

/* Чекбоксы */
.dictation-editor-modal__sentences-table .col-checkbox-create-audio {
  width: 40px;
  text-align: center;
}

/* Аудио-кнопки в таблице */
.dictation-editor-modal__sentences-table .col-play-translation,
.dictation-editor-modal__sentences-table .col-generate-tts,
.dictation-editor-modal__sentences-table .col-play-audio {
  width: 36px;
  text-align: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-button-text-transparent, #888);
  transition: color 0.2s;
}

.dictation-editor-modal__sentences-table .col-play-translation:hover,
.dictation-editor-modal__sentences-table .col-generate-tts:hover,
.dictation-editor-modal__sentences-table .col-play-audio:hover {
  color: var(--color-button-text-yellow, #f9c609);
}

/* Поля ввода в таблице */
.dictation-editor-modal__sentences-table td.col-original,
.dictation-editor-modal__sentences-table td.col-translation,
.dictation-editor-modal__sentences-table td.col-explanation {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dictation-editor-modal__sentences-table td.col-start,
.dictation-editor-modal__sentences-table td.col-end {
  width: 80px;
}

.dictation-editor-modal__sentences-table td.col-start .time-label,
.dictation-editor-modal__sentences-table td.col-end .time-label {
  display: inline-block;
  width: 70px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: monospace;
  text-align: center;
  color: var(--color-text, #224156);
  background: transparent;
}

/* Поля ввода в таблице редактора */
.dictation-editor-modal__sentences-table td input.table-input {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text, #224156);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.dictation-editor-modal__sentences-table td input.table-input:hover {
  border-color: var(--color-border-light, #d0d0d0);
  background: rgba(255,255,255,0.5);
}

.dictation-editor-modal__sentences-table td input.table-input:focus {
  border-color: var(--color-button-purple, #7c5cbf);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(124, 92, 191, 0.15);
}

/* Выделенная строка */
.dictation-editor-modal__sentences-table tbody tr.selected {
  background: var(--color-hover, #f0eeeb);
}

.dictation-editor-modal__sentences-table tbody tr:hover {
  background: var(--color-hover, #f0eeeb);
}

/* Кнопка edit-all-creating */
.dictation-editor-modal__button-header-edit-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-button-text-transparent, #888);
}

.dictation-editor-modal__button-header-edit-all:hover {
  color: var(--color-button-text-yellow, #f9c609);
}

/* Чекбокс в шапке таблицы */
#editorModalSelectAllCheckboxLabel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== ВКЛАДКА "ОЗВУЧКА ОРИГІНАЛУ (САМ)" (voice-original-self) ===== */
.dictation-editor-modal__self-audio-content {
  padding: 16px;
  overflow: auto;
}

/* Дві панелі під волною: ліва і права, при звуженні права йде вниз */
.dictation-editor-modal__self-bottom-panels {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

/* Ліва панель: Play + Start/End + ножиці */
.dictation-editor-modal__self-left-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Права панель: запис з мікрофона */
.dictation-editor-modal__self-right-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-left: auto;
}

/* Перший рядок правої панелі: індикатор + canvas + кнопка запису */
.dictation-editor-modal__self-mic-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Індикатор запису (рожевий кружок) */
.dictation-editor-modal__rec-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s;
}
.dictation-editor-modal__rec-indicator i {
  width: 16px;
  height: 16px;
  color: var(--color-button-purple, #7c5cbf);
  transition: color 0.2s;
}
.dictation-editor-modal__rec-indicator.active i {
  color: #e84393;
  animation: dictation-editor-modal-pulse 1s infinite;
}

@keyframes dictation-editor-modal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Візуалізатор (canvas зі стовпчиками) */
.dictation-editor-modal__audio-visualizer {
  width: 162px;
  height: 44px;
  border-radius: 6px;
  background: var(--color-hover, #f0eeeb);
}

/* Кнопка запису (фіолетова, як "...") */
.dictation-editor-modal__mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-button-purple);
  color: var(--color-button-text-purple);
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 6px;
}
.dictation-editor-modal__mic-btn:hover {
  border: 1px solid var(--color-button-shadow-purple);
  box-shadow: 0 3px 0 0 var(--color-button-shadow-purple);
}
.dictation-editor-modal__mic-btn:focus {
  outline: 2px solid var(--color-button-text-purple);
  outline-offset: 2px;
}
.dictation-editor-modal__mic-btn:active {
  border: 1px solid var(--color-button-shadow-purple);
}
.dictation-editor-modal__mic-btn.recording {
  background: #e84393;
  animation: dictation-editor-modal-pulse 1s infinite;
}
.dictation-editor-modal__mic-btn i {
  width: 20px;
  height: 20px;
}

/* Другий рядок правої панелі: лейба + пагон + play + apply */
.dictation-editor-modal__self-mic-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.dictation-editor-modal__self-mic-file-row {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dictation-editor-modal__self-mic-filename {
  font-size: 13px;
  color: var(--color-text, #224156);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Кнопка-пагон вниз (dropdown) */
.dictation-editor-modal__mic-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-button-text-transparent, #888);
  transition: all 0.2s;
  flex-shrink: 0;
}
.dictation-editor-modal__mic-dropdown-btn:hover:not(:disabled) {
  border: 1px solid var(--color-button-shadow-purple);
  box-shadow: 0 2px 0 0 var(--color-button-shadow-purple);
}
.dictation-editor-modal__mic-dropdown-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.dictation-editor-modal__mic-dropdown-btn i {
  width: 14px;
  height: 14px;
}

/* Випадаючий список записаних файлів */
.dictation-editor-modal__self-mic-dropdown-wrapper {
  position: relative;
}

.dictation-editor-modal__self-mic-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 4px 0;
}

.dictation-editor-modal__self-mic-dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--color-text, #224156);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.dictation-editor-modal__self-mic-dropdown-item:hover {
  background: var(--color-hover, #f0eeeb);
}
.dictation-editor-modal__self-mic-dropdown-item.active {
  background: var(--color-hover, #f0eeeb);
  font-weight: 600;
}
.dictation-editor-modal__self-mic-dropdown-item i {
  width: 14px;
  height: 14px;
  color: var(--color-button-purple, #7c5cbf);
}

/* Кнопки дій (play, apply) — стиль як "..." */
.dictation-editor-modal__mic-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-button-purple);
  color: var(--color-button-text-purple);
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 6px;
}
.dictation-editor-modal__mic-action-btn:hover:not(:disabled) {
  border: 1px solid var(--color-button-shadow-purple);
  box-shadow: 0 3px 0 0 var(--color-button-shadow-purple);
}
.dictation-editor-modal__mic-action-btn:focus {
  outline: 2px solid var(--color-button-text-purple);
  outline-offset: 2px;
}
.dictation-editor-modal__mic-action-btn:active {
  border: 1px solid var(--color-button-shadow-purple);
}
.dictation-editor-modal__mic-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.dictation-editor-modal__mic-action-btn i {
  width: 20px;
  height: 20px;
}

/* ===== АДАПТИВНОСТЬ ТАБЛИЦЫ ===== */
@media (max-width: 768px) {
  .dictation-editor-modal__sentences-table {
    font-size: 12px;
  }

  .dictation-editor-modal__sentences-table th,
  .dictation-editor-modal__sentences-table td {
    padding: 6px 8px;
  }

  .dictation-editor-modal__table-controls {
    gap: 8px;
  }

  .dictation-editor-modal__table-control-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ===== NEW DICTATION FILL MODAL ===== */
#newDictationFillModal {
  position: fixed;
  inset: 0;
  z-index: 100310;
  display: none;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}

#newDictationFillModal .new-dictation-fill-modal__content {
  position: relative;
  width: min(90vw, 800px);
  max-height: 95vh;
  height: 90vh;
  background: var(--color-panel-bg, #f5f3f0);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px;
}

/* Row 1: Header */
.new-dictation-fill-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.new-dictation-fill-modal__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.new-dictation-fill-modal__id-label {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
  font-family: monospace;
}

#newDictationFillTitle {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  font-size: 15px;
  background: var(--color-input-bg, #fff);
  color: var(--color-text, #1f2937);
  outline: none;
  transition: border-color 0.15s;
}

#newDictationFillTitle:focus {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.new-dictation-fill-modal__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#newDictationFillCreateBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--color-button-yellow);
  color: var(--color-button-text-yellow);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

#newDictationFillCreateBtn:hover {
  opacity: 0.85;
}

#newDictationFillCreateBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

#newDictationFillCreateBtn i[data-lucide] {
  width: 18px;
  height: 18px;
}

#newDictationFillCloseBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-secondary, #6b7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#newDictationFillCloseBtn:hover {
  background: var(--color-hover, #f3f4f6);
  color: var(--color-text, #1f2937);
}

#newDictationFillCloseBtn i {
  width: 18px;
  height: 18px;
}

/* Row 2: Two-panel layout */
.new-dictation-fill-modal__two-panels {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.new-dictation-fill-modal__left-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-dictation-fill-modal__lang-pair {
  min-height: 36px;
  position: relative;
}

/* Дропдаун списка языков — левый нижний угол флага совпадает с левым верхним углом списка */
.new-dictation-fill-modal__lang-pair .flag-pair-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  z-index: 1100;
}

.new-dictation-fill-modal__lang-pair .flag-pair-dropdown[data-side="left"] {
  left: 0;
}

.new-dictation-fill-modal__lang-pair .flag-pair-dropdown[data-side="right"] {
  right: 0;
}

/* Флаги в строку (en => ru) — как в других модалках */
.new-dictation-fill-modal__lang-pair .flag-pair-combo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.new-dictation-fill-modal__lang-pair .flag-pair-combo i[data-lucide] {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary, #6b7280);
}

.new-dictation-fill-modal__delimiter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-dictation-fill-modal__delimiter-row label {
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
}

#newDictationFillDelimiter {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 4px;
  font-size: 13px;
  background: var(--color-input-bg, #fff);
  color: var(--color-text, #1f2937);
  outline: none;
  text-align: center;
  font-family: monospace;
}

#newDictationFillDelimiter:focus {
  border-color: var(--color-primary, #3b82f6);
}

/* Right panel: Voice mode (как в редакторе) */
.new-dictation-fill-modal__right-panel {
  flex-shrink: 0;
  min-width: 180px;
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border-light, #eee);
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-text, #224156);
  padding-top: 0;
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text, #224156);
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border-light, #bbb);
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-radio input[type="radio"]:checked {
  border-color: var(--color-button-text-yellow, #f9c609);
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: var(--color-button-text-yellow, #f9c609);
  border-radius: 50%;
}

.new-dictation-fill-modal__right-panel .new-dictation-fill-modal__voice-mode-radio input[type="radio"]:hover {
  border-color: var(--color-button-text-yellow, #f9c609);
}

/* Row 4: Text section */
.new-dictation-fill-modal__text-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.new-dictation-fill-modal__text-section > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text, #1f2937);
  flex-shrink: 0;
}

#newDictationFillText {
  flex: 1;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--color-input-bg, #fff);
  color: var(--color-text, #1f2937);
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  transition: border-color 0.15s;
  tab-size: 4;
}

#newDictationFillText:focus {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

#newDictationFillText:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-placeholder, #9ca3af);
  pointer-events: none;
}

/* Подсветка строк перевода (аналог .line-translation из style_dictation_editor.css) */
#newDictationFillText .line-translation {
  color: var(--color-button-text-orange, rgb(250, 147, 21));
}

/* Стилизация скроллбара */
#newDictationFillText::-webkit-scrollbar {
  width: 6px;
}

#newDictationFillText::-webkit-scrollbar-track {
  background: transparent;
}

#newDictationFillText::-webkit-scrollbar-thumb {
  background: var(--color-border, #d1d5db);
  border-radius: 3px;
}

#newDictationFillText::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary, #6b7280);
}

/* ===== ВКЛАДКА 5: ЯЗЫКИ ПЕРЕВОДА (tab-voice-translations) ===== */
.dictation-editor-modal__translations-content {
  padding: 12px;
}

.dictation-editor-modal__translations-table {
  width: 100%;
  border-collapse: collapse;
}

.dictation-editor-modal__translations-table th,
.dictation-editor-modal__translations-table td {
  padding: 0;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light, #e9ecef);
}

.dictation-editor-modal__translations-table th:first-child,
.dictation-editor-modal__translations-table td:first-child {
  padding: 8px 12px;
}

.dictation-editor-modal__translations-table th {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dictation-editor-modal__translations-table td:last-child,
.dictation-editor-modal__translations-table th.col-actions {
  width: 40px;
  padding: 0;
  text-align: center;
}

/* Кнопка добавления перевода — на всю ячейку шапки */
.dictation-editor-modal__translations-table .translations-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary, #6b7280);
  cursor: pointer;
}

.dictation-editor-modal__translations-table .translations-add-btn:hover {
  background: transparent;
  color: #27ae60;
}

.dictation-editor-modal__translations-table .translations-add-btn i {
  width: 16px;
  height: 16px;
}

/* Кнопка удаления перевода — на всю ячейку строки */
.dictation-editor-modal__translations-table .translations-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary, #999);
  cursor: pointer;
}

.dictation-editor-modal__translations-table .translations-delete-btn:hover {
  background: transparent;
  color: #e74c3c;
}

.dictation-editor-modal__translations-table .translations-delete-btn i {
  width: 16px;
  height: 16px;
}

/* ===== МОДАЛЬНОЕ ОКНО ДОБАВЛЕНИЯ ЯЗЫКА ПЕРЕВОДА (addTranslationModal) ===== */
#addTranslationModal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100260;
}

.add-translation-modal__content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 20px;
}

.add-translation-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.add-translation-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text, #224156);
}

.add-translation-modal__close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-secondary, #999);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.add-translation-modal__close-btn:hover {
  color: var(--color-text, #224156);
  background: var(--color-hover, #f0eeeb);
}

.add-translation-modal__close-btn i {
  width: 20px;
  height: 20px;
}

.add-translation-modal__body {
  margin-bottom: 20px;
}

.add-translation-modal__footer {
  display: flex;
  justify-content: flex-end;
}

.add-translation-modal__add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #3b82f6);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-translation-modal__add-btn:hover {
  background: var(--color-primary-hover, #2563eb);
}

.add-translation-modal__add-btn i {
  width: 16px;
  height: 16px;
}

/* ===== МОДАЛЬНОЕ ОКНО ДОБАВЛЕНИЯ СТРОКИ (addRowModal) ===== */
#addRowModal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100270;
}

.add-row-modal__content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 640px;
  width: calc(100% - 32px);
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.add-row-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.add-row-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text, #224156);
}

.add-row-modal__close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-secondary, #999);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.add-row-modal__close-btn:hover {
  color: var(--color-text, #224156);
  background: var(--color-hover, #f0eeeb);
}

.add-row-modal__close-btn i {
  width: 20px;
  height: 20px;
}

.add-row-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-row-modal__orig-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-row-modal__orig-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-row-modal__orig-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text, #224156);
  background: var(--color-panel-bg, #f9f9f9);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.add-row-modal__orig-row input:focus {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.add-row-modal__translations-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-row-modal__translations-section label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#addRowModalTranslationsTable {
  width: 100%;
  border-collapse: collapse;
}

#addRowModalTranslationsTable th,
#addRowModalTranslationsTable td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light, #e9ecef);
}

#addRowModalTranslationsTable th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}

#addRowModalTranslationsTable td input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border-light, #ddd);
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-text, #224156);
  background: var(--color-panel-bg, #f9f9f9);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#addRowModalTranslationsTable td input:focus {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.add-row-modal__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.add-row-modal__create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #3b82f6);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.add-row-modal__create-btn:hover {
  background: var(--color-primary-hover, #2563eb);
}

.add-row-modal__create-btn i {
  width: 16px;
  height: 16px;
}

