/* ============================================================
   ЦЕЛЕВЫЕ ИНСТРУКТАЖИ
   ============================================================ */

#targetsList {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.targets-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.targets-empty .empty-icon {
  display: inline-block;
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.5;
}
.targets-empty .empty-icon svg {
  width: 48px;
  height: 48px;
}
.targets-empty .empty-text {
  font-size: 14px;
  line-height: 1.6;
}
.targets-empty .empty-text b {
  color: var(--accent);
}

.target-item {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.target-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.target-info {
  flex: 1;
  min-width: 0;
}
.target-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.target-shift {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  flex-wrap: wrap;
}
.target-shift .shift-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.target-shift .shift-icon svg {
  width: 12px;
  height: 12px;
}

.target-date-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--accent-soft, rgba(74, 124, 255, 0.15));
  color: var(--accent);
}

.target-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.target-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
}

.target-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.target-play:active { transform: scale(0.92); }
.target-play .icon {
  width: 16px;
  height: 16px;
}

.target-wave {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.target-wave span {
  display: inline-block;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.5;
  flex-shrink: 0;
}

.target-duration {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.target-comment {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.target-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.target-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s;
}
.target-btn:active { background: var(--bg-tertiary); }
.target-btn .icon {
  width: 14px;
  height: 14px;
}
.target-btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.target-btn.danger:active {
  background: rgba(224, 74, 74, 0.1);
}
.target-btn.share {
  color: var(--accent);
  border-color: var(--accent);
}
.target-btn.share:active {
  background: rgba(74, 124, 255, 0.1);
}

/* ============================================================
   МОДАЛКА СОЗДАНИЯ
   ============================================================ */

.record-area {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.record-timer {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.record-timer.recording {
  color: var(--danger);
  animation: blinkRec 1s infinite;
}
@keyframes blinkRec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.audio-action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.record-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(74, 124, 255, 0.4);
  transition: transform 0.15s, background 0.15s;
}
.record-btn .icon {
  width: 26px;
  height: 26px;
}
.record-btn:active { transform: scale(0.92); }

.record-btn.recording {
  background: var(--danger);
  animation: pulseRecBtn 1s infinite;
}
@keyframes pulseRecBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 74, 74, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(224, 74, 74, 0); }
}

.record-btn.upload-audio-btn {
  background: var(--bg-secondary);
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: none;
}
.record-btn.upload-audio-btn:active {
  background: rgba(74, 124, 255, 0.15);
}

.record-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.record-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px;
}

.record-preview audio {
  flex: 1;
  height: 36px;
  min-width: 0;
}

.record-preview .rec-dur {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.record-preview .rec-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.record-preview .rec-remove:active { transform: scale(0.9); }
.record-preview .rec-remove .icon {
  width: 14px;
  height: 14px;
}

/* Поле даты */
.target-date-input {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 2px;
}

/* Кнопки смены (Дневная / Ночная) */
.shift-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.shift-num {
  width: 80px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  text-align: center;
  outline: none;
}

.shift-type {
  display: flex;
  gap: 6px;
  flex: 1;
}

.shift-btn {
  flex: 1;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s,
              box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.shift-btn .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.shift-btn .shift-btn-label {
  white-space: nowrap;
}

/* Галочка — по умолчанию спрятана */
.shift-btn .shift-btn-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
  stroke-width: 3;
}

.shift-btn:active {
  background: var(--bg-tertiary);
  transform: scale(0.98);
}

/* === АКТИВНАЯ КНОПКА (вариант F) === */
.shift-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent),
              0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}

.shift-btn.active .icon {
  color: #fff;
}

.shift-btn.active .shift-btn-check {
  opacity: 1;
  transform: scale(1);
}

/* Мягкий «пульс» при выборе — короткая вспышка */
.shift-btn.active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: shiftPulse 0.4s ease-out;
  pointer-events: none;
}

@keyframes shiftPulse {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.08); }
}

/* Fallback для браузеров без color-mix() */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .shift-btn.active {
    box-shadow: 0 0 0 3px rgba(74, 124, 255, 0.35),
                0 4px 12px rgba(74, 124, 255, 0.4);
  }
}

@media (max-width: 400px) {
  .record-btn {
    width: 56px;
    height: 56px;
  }
  .record-btn .icon {
    width: 22px;
    height: 22px;
  }
  .record-timer {
    font-size: 26px;
  }
  .shift-row {
    flex-direction: column;
    align-items: stretch;
  }
  .shift-num {
    width: 100%;
  }
}